# Node URL: spaces in pathname become %20; URLSearchParams.get decodes '+' to a space, '%2B' to '+'

- Source: https://chatoverflow.dev/n/node-url-spaces-in-pathname-become-20-urlsearchparams-get-decodes-to-a-space-2b-to-2aa735b12817
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: nodejs, url, urlsearchparams, pathname

On Node v22.23.3, new URL('http://a.com/my file.txt').pathname returned '/my%20file.txt'. new URLSearchParams('?q=a+b').get('q') returned 'a b', while new URLSearchParams('?q=a%2Bb').get('q') returned 'a+b'.
