URL Encode and Decode — Percent-Encoding Tool

Percent-encode text for safe use in URLs and query strings, or decode an encoded URL back to readable text.

🪢

URL Encode / Decode

Text • percent-encoding

0 chars
0 chars

How to Use the URL Encode / Decode

  1. Pick a direction — use the toggle at the top (e.g. encode vs decode).
  2. Type or paste your text — the result updates live as you type; large inputs are fine.
  3. Copy the result — one click copies the output to your clipboard.
  4. Swap — flip the direction (⇄) to reverse the conversion instantly.

Why Use This URL Encode / Decode

🎯

Reversible in one click

Encoding and decoding share the page, so any result can be pasted straight back to confirm it round-trips to the text you started with — the quickest check that nothing was mangled.

Live as you type

Results are recalculated on every keystroke, with no submit step and no page reload, so a value can be adjusted until the answer looks right rather than guessed once.

🔒

100% private

Everything runs in your browser — no account, no uploads, nothing leaves your device.

Understanding the URL Encode / Decode

URL encoding (also called percent-encoding) replaces characters that are unsafe or reserved in a web address with a % followed by their hexadecimal byte value — a space becomes %20, an ampersand becomes %26. It keeps query strings, form data and links valid when they contain spaces, symbols, or non-English characters.

Anyone building links, REST APIs, UTM tracking URLs or web forms needs it constantly. This tool encodes text for safe use inside a URL and decodes percent-encoded URLs back to readable text — instantly and privately in your browser, with nothing uploaded.

Formula & Logic

URLs may only contain a restricted set of ASCII characters, so anything outside it — spaces, ampersands, non-English letters — must be percent-encoded: replaced by a % followed by the character's hexadecimal byte value. The rule that trips people is context. A character that is safe in one part of a URL is dangerous in another: an ampersand is a legitimate separator between query parameters but must be encoded when it appears inside a parameter's value, or it silently splits the parameter in two. Multi-byte UTF-8 characters encode as several percent sequences, one per byte.

Unsafe character → % + two hex digits of its byte valueSpace → %20 (or + in application/x-www-form-urlencoded)Reserved: : / ? # [ ] @ ! $ & ' ( ) * + , ; =Unreserved and never encoded: A–Z a–z 0–9 - _ . ~

where:

%20 vs +
both mean space, but + only inside form-encoded query strings, never in a path
UTF-8
each byte of a multi-byte character becomes its own %XX sequence
double encoding
encoding an already-encoded string turns % into %25 and breaks the URL

Assumptions: Encode each component separately, before assembling the URL — never encode a complete URL in one pass, which would destroy the structural separators.

Step-by-Step Example: Encoding a Query Value Containing "a b&c=d"

Encode a parameter value whose characters would otherwise break the query string.

  • Raw valuea b&c=d
  1. The letters a, b, c and d are unreserved and pass through unchanged.
  2. Space is byte 0x20, so it becomes %20.
  3. Ampersand is byte 0x26, so it becomes %26 — vital, or it would start a new parameter.
  4. Equals is byte 0x3D, so it becomes %3D — vital, or it would look like a key/value split.
  5. Result: a%20b%26c%3Dd.
  6. Assemble the URL: ?q=a%20b%26c%3Dd, which now carries the value intact.

Resulta b&c=d encodes to a%20b%26c%3Dd

Leaving the ampersand raw would produce ?q=a b&c=d, which a server reads as two parameters — q with the value "a b" and a separate c with value "d". The data loss is silent, which is why this is such a persistent source of bugs.

URL Encode / Decode FAQ

Whenever a value goes into a URL or query string and may contain spaces or special characters like &, ?, = or #. Encoding turns them into %XX sequences so the URL stays valid.

Related Converters

✔ Written & reviewed by Dr Sam — 20+ yrs in management & research leadership📅 Last updated September 2026📚 Sources: IETF RFC 4648, RFC 3986 & WHATWG/W3C specifications📑 How we build & check these