URL Encoder & Decoder

Encode and decode URLs instantly — free, no sign-up. Live sync as you type, bulk line-by-line mode, encodeURIComponent vs encodeURI explained, and a URL analyzer that splits query parameters.

  • ✓ Free forever
  • ✓ No sign-up
  • ✓ Private — runs in your browser

Loading tool…

About this url encoder & decoder

How to use it

  1. Choose Encode or Decode, and for encoding pick encodeURIComponent (query values) or encodeURI (whole URLs) — the hint under the toggle explains which to use.
  2. Type or paste your text. The output updates live as you type, with character counts and the number of encoded sequences.
  3. Turn on Bulk mode to process a list of URLs, one per line, with per-line results in a table.
  4. Paste a full URL into the analyzer to split it into protocol, host, port, path, decoded query parameters, and fragment.
  5. Copy the output. Malformed %-sequences are flagged and left exactly as typed — nothing is ever dropped.

The method behind it

Percent-encoding replaces each unsafe byte with % followed by two hex digits — the bytes are the character's UTF-8 encoding, so é becomes %C3%A9 (two bytes, two sequences). JavaScript has two encoders because URLs have two jobs: encodeURIComponent escapes everything except the unreserved characters (A–Z a–z 0–9 - _ . ! ~ * ' ( )), which makes it correct for a single query value — q=hello world becomes q=hello%20world, and the & and = inside a value can't be mistaken for structure. encodeURI is gentler: it preserves reserved structure characters (: / ? # [ ] @ ! $ & ' ( ) * + , ; =) so a whole URL stays clickable, encoding only the truly illegal characters like spaces. Decoding reverses the process, converting each valid %XX run back through UTF-8. This tool decodes defensively: a malformed sequence such as %ZZ or a trailing % is not valid hex, so it is passed through byte-for-byte and flagged instead of being dropped or blanking the whole output. Reference: the WHATWG URL Standard, which describes how browsers parse the result — https://url.spec.whatwg.org/

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent escapes everything except A–Z a–z 0–9 - _ . ! ~ * ' ( ) — use it for a single query value or API parameter, where characters like ? & = must not be mistaken for URL structure. encodeURI is gentler: it leaves reserved structure characters (: / ? # [ ] @ ! $ & ' ( ) * + , ; =) alone and encodes only truly illegal characters like spaces — use it for whole URLs you want to keep clickable. Rule of thumb: encoding one value → encodeURIComponent; encoding a full address → encodeURI.

What does %20 mean in a URL?

It is a space. Percent-encoding represents unsafe bytes as % plus two hexadecimal digits, and 20 is the hex code for the space character (byte 0x20). You will also meet %2F (/), %3F (?), %3D (=), and %26 (&) — reserved characters, escaped when they appear inside a value instead of acting as URL structure.

How do I encode or decode many URLs at once?

Turn on Bulk mode and paste one URL per line — each line is processed independently and the results appear in a per-line table. Lines containing malformed sequences are highlighted so you can spot the problem rows at a glance.

What happens if my text has a broken %-sequence like %ZZ?

It is passed through exactly as typed and flagged — never deleted, and never turned into a blank output. %ZZ is not valid hexadecimal, so there is nothing correct to decode it to; the tool decodes every valid %XX run around it and leaves the broken part untouched so you can fix it yourself.

Is my data sent to a server?

No. Encoding, decoding, and analysis all run in your browser with JavaScript — nothing is uploaded, stored, or logged. That makes the tool safe for URLs containing API keys, session tokens, or other secrets you would never paste into a server-side tool.

Worked example

Encoding a search URL: input https://example.com/search?q=hello world&lang=en with encodeURIComponent gives https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3Den — every reserved character escaped, safe to embed as a single API parameter value. With encodeURI the same input gives https://example.com/search?q=hello%20world&lang=en — structure intact, only the space encoded.

Decoding: paste https://example.com/p?name=%C3%89mile%20Claire in Decode mode and you get https://example.com/p?name=Émile Claire — %C3%89 is the two-byte UTF-8 encoding of É.

Analyzer: https://example.com:8080/shop?q=red%20shoes#reviews splits into protocol https:, host example.com, port 8080, path /shop, query parameter q = red shoes (decoded), and fragment reviews.

Related tools