plain/devtools home

URL encoder and decoder

Percent-encode text for use in URLs, decode it back, and break a query string into readable parameters.

tool 06 of 12 []
all shortcuts ?

url-encodersamplesCtrl↵ run · s sample · c copy

never leaves your browser

How to use it

  1. Pick a mode. Component encodes everything except letters, digits and - _ . ! ~ * ' ( ), which is right for a single query value or path segment.
  2. Full URL mode leaves the characters that structure a URL (: / ? # & =) alone, so use it only for a whole address that is already assembled.
  3. Form mode behaves like Component but writes spaces as +, the convention of application/x-www-form-urlencoded bodies and many query strings.
  4. Use Parse to split a URL or query string into decoded key and value pairs.

Examples

Select an example to load it into the tool.

  • Text with spaces and &café & tea = 5% off?
  • Encoded value to decodecaf%C3%A9%20%26%20tea%20%3D%205%25%20off%3F
  • URL to parsehttps://example.com/search?q=caf%C3%A9+tea&page=2&tag=a&tag=b#top

Frequently asked questions

encodeURI or encodeURIComponent?

Use encodeURIComponent (Component mode) for any piece you insert into a URL, such as a query value. encodeURI is only for an entire URL, and it does not escape & = ? #, so it would let a value break out of its parameter.

Should a space be %20 or +?

In a URL path, always %20. In a query string, + for a space is a long-standing form convention, but %20 is understood everywhere. When decoding, use Form mode only if the data really is form-encoded, since a literal + in Component mode stays a plus.

Why does decoding say malformed?

A % must be followed by two hex digits, and multi-byte characters such as an accented e need their whole UTF-8 sequence (%C3%A9). A lone % or a cut-off sequence is an error.

Is anything sent to a server?

No, it all runs in your browser using the standard encodeURIComponent and decodeURIComponent functions.

How are repeated parameters shown?

Each occurrence is listed separately in order, for example tag=a and tag=b, so you can see exactly what a server would receive.

Related tools

esc
↑↓ move↵ open? all shortcuts

Keyboard shortcuts

Cmd or Ctrl shortcuts always work.
Everywhere
Everywhere
Open the command palette
CtrlK
Open the palette (outside a text field)
/
Show these shortcuts
?
Toggle light and dark theme
t
Go home
gh
Go to all tools
gt
On a tool page
On a tool page
Run the main action
Ctrl↵
Copy the output
c
Load the next sample
s
Focus the input
i
Leave a text field
Esc
Previous or next tool
[]
In the palette
In the palette
Move the selection
↑↓
Open the selected item
↵
Close
Esc