Searching...
No tools found

URL Encoder/Decoder Guide: Encode & Decode Percent-Encoding

Text··6 min read

Guide to encoding and decoding URL percent-encoding. Encode text to a URL-safe string or decode percent-encoded strings, entirely in your browser with no uploads.

Most online URL encoders either upload your text to a server, limit the input size, or silently corrupt non-ASCII characters. This guide walks through a tool that runs entirely in your browser, preserves surrogates, and gives you full control over how percent‑encoding works.

Type or paste any text into the box, click Encode to produce a URL‑safe percent‑encoded string, or click Decode to reverse it. The result copies to your clipboard or downloads as a .txt file, and edge‑case settings let you preserve safe characters (– _.~) or keep surrogate pairs intact if you are working with emoji or CJK.

Why this tool matters

Place‑formats differ in how they count characters: a meta description is truncated on pixels rather than characters, a tweet counts a link as 23 regardless of its real length, and a server‑side encoder may silently drop characters you need. Knowing exactly what your tool produces — and having the bytes to prove it — is the only way to hit a length limit deliberately instead of guessing and cutting something you needed.

How encoding works

URL percent‑encoding replaces unsafe characters with a % followed by two hexadecimal digits representing the character's code unit. For example:

  • Space becomes %20
  • Exclamation mark becomes %21
  • becomes %22
  • # becomes %23

Alphanumeric characters (A–Z, a–z, 0–9) and – _.~ are never encoded by default. Everything else becomes %XX.

How decoding works

Decoding reverses the process: %20 becomes a space, %21 becomes !, and so on. A bare % not followed by two hex digits survives as‑is and is left unchanged during decode.

Edge‑case controls

Settings let you toggle two important behaviours:

Preserve safe characters
By default, alphanumeric characters and – _.~ are never encoded. Turn this off if you want every non‑alphanumeric character to be percent‑encoded.
Preserve surrogate pairs
Code points above 0xFFFF (astral characters like most emoji) are encoded as two surrogate units. Turn this on to keep them as‑is instead of encoding each unit separately.

Common use cases

  • Encoding a URL query string so it can be safely transmitted
  • Decoding a previously encoded string to read the original text
  • Verifying how a platform encodes special characters
  • Testing edge cases like emoji, CJK characters, and bare percent signs

Wrapping up

Encoding and decoding URL percent‑encoding is a fundamental skill for web developers and anyone who works with URLs. Understand the rules, use a consistent tool, and always verify the output bytes — especially when the stakes are a length limit or a character count that decides whether content is accepted or truncated.

Frequently asked questions

Does this tool send my text to a server?

No. All encoding and decoding happens entirely in your browser using JavaScript. Your text never leaves your machine.

What characters are safe and never encoded?

By default, alphanumeric characters (A–Z, a–z, 0–9) and – _.~ are never encoded. You can toggle this in Settings.

How are emoji and CJK characters handled?

Code points above 0xFFFF (astral characters like most emoji) are encoded as surrogate pairs (%XX per unit). Decode reconstructs the original character.

What happens to a bare % sign?

A percent sign not followed by two hex digits survives encode as‑is and is left as‑is during decode, marked as “unresolved %”.

Can I encode an already‑encoded string without double‑encoding it?

The engine preserves already‑valid %XX sequences on encode, so they pass through unchanged. Decode will convert them back to the original character.

Written by the Chaudify team. Every tool mentioned here runs entirely in your browser — nothing you open is ever uploaded. Browse all tools or read more guides.