Skip to main content

URL Encode / Decode

URLs can only carry a small set of characters; everything else travels as %XX percent escapes. This tool encodes and decodes both ways, with the two modes that matter: component (for one query value — encodes everything structural) and full URL (keeps : / ? & = intact so a whole address stays an address).

Decoding reports a bad escape by position instead of failing silently — and everything runs in your browser.

Direction
What are you encoding?

A value that will sit inside a URL (a query parameter, a slug) needs component encoding; a whole URL keeps its : / ? & structure.

Converted entirely in your browser — nothing is sent anywhere.

Embed this calculator on your website →

The formula

encode = UTF-8 bytes → each unsafe byte becomes % + two hex digits · space = %20 (or + in form data)

  • component mode — encodes every character with structural meaning (& = ? # / and friends), so a value can sit inside a query string without breaking out of its slot.
  • full URL mode — leaves the skeleton (`:/?#[]@!$&'()*+,;=`) alone and encodes only what cannot appear at all, like spaces and non-ASCII text.
  • the + question — in query strings produced by HTML forms, + means a space. In paths it means a literal plus. Decoding offers both readings; when in doubt for a query value, keep “+ means space” on.

Worked example: “a b&c=d” in component mode → a%20b%26c%3Dd.

How it works

Percent-encoding works on bytes: your text is converted to UTF-8, and every byte outside the safe set for the chosen mode is written as % followed by its two-digit hex value. That is why an accented letter takes two escapes — it is two UTF-8 bytes — and why the same text encodes differently in component and full modes: the safe set is the whole difference.

Decoding walks the string escape by escape. A % not followed by two hex digits, or an escape sequence that does not form valid UTF-8, is reported with its exact position — the two failure modes behind most mysterious “the API rejected my URL” bugs.

Examples

  • A search phrase as a value → “tea & biscuits? 100% yes” in component mode becomes tea%20%26%20biscuits%3F%20100%25%20yes — safe to place after ?q= .
  • A file path with a space → “my file.pdf” in full mode keeps the path structure and encodes just the space: my%20file.pdf.
  • Reading a tracked link → decode a utm-laden URL to see the raw campaign values the tracker encoded.

Frequently asked questions

Which mode should I use?

Component mode whenever you are building one piece of a URL — a query value, a path segment, a redirect target. Full URL mode only when you have a complete URL that needs its unsafe characters (spaces, accents) repaired while its structure stays put.

Is a space %20 or +?

Both exist. %20 is the encoding everywhere; + meaning space is a legacy of HTML form submissions and is only understood that way inside query strings. When you encode a query value yourself, %20 is always safe; when you decode someone else’s query string, + usually means space.

Why did decoding report invalid UTF-8?

The escapes decoded to bytes that are not valid UTF-8 — commonly because the string was encoded from a different character set (such as Latin-1) or was double-encoded. If decoding once leaves %XX escapes in the result, the string was encoded twice; decode it again.

Is anything sent to a server?

No — encoding and decoding run in your browser. URLs often carry tokens and personal data; they are exactly what should stay on your device.