URL Encoding Explained — When and How to Encode

Published 2026-05-28

Encode text for safe use in URLs or decode percent-encoded strings instantly in your browser.

Try URL Encoder & Decoder free →

The problem

You're building a URL with query parameters and one of the values has spaces, ampersands, or unicode characters. If you don't encode it, the URL breaks — the browser or server misparses it and you get a 400 or the wrong value. Or you're reading a log file full of %20 and %3D and you just want to see the actual text. You could open the browser console and type encodeURIComponent(), but you have to remember whether that's the right function or if you need encodeURI() — they handle different characters.

How it works

  1. Paste a string or full URL into the input.
  2. Click Encode or Decode. Spaces become %20, special characters become percent-encoded sequences — or the reverse.
  3. Copy the result. One click to clipboard.

Your data never leaves your browser. All processing happens locally.

When to use this tool

Building query strings by hand, debugging URLs in server logs, encoding redirect URIs for OAuth flows, checking what a garbled URL actually says, or any time you need to safely pass a value as a URL parameter without breaking the structure of the URL.

Why I built it

URL encoding is one of those things I do often enough to need a tool, but not often enough to remember that encodeURIComponent and encodeURI handle different characters. Having it in a tab is faster than opening a console, and I don't have to think about whether my input is going to a server.

Tips and reference

Characters that must be encoded in URL query parameters:

CharacterEncodedNotes
(space)%20Also + in HTML form data
&%26Separates query parameters
=%3DKey-value separator
?%3FStarts the query string
#%23Fragment identifier
/%2FPath separator
@%40Used in email addresses and userinfo
+%2BLiteral plus sign (unencoded + means space in forms)
%%25The escape character itself

When in doubt, encode the value — most decoders handle over-encoding gracefully, but under-encoding breaks parsing.


Built with vanilla HTML/JS. No frameworks, no backend, loads instantly.

Related tools

Joe — Software engineer with 20+ years of experience. Built ToolRack to provide fast, private tools without the bloat.