Encoding

URL Encode/Decode

Encode and decode URLs — characters that need escaping in links and query parameters.

URL encoding (percent-encoding) replaces characters that aren't allowed in a URL — spaces, non-Latin letters, special characters — with %XX sequences, where XX is the hex code of the byte. This keeps links and query parameters from getting mangled in transit.

How to use it

Common uses

Things to keep in mind

Encode parameter values, not the whole URL at once — otherwise you'll also encode the separators you need (:, /, ?, &).

JavaScript's encodeURIComponent and encodeURI encode different character sets — the former is meant specifically for parameter values.

Article about this tool: URL Encode/Decode: percent-encoding in links

Frequently asked questions

What is the difference between Component and URI encoding?

Component encoding (encodeURIComponent) escapes nearly all reserved characters, so it's right for a single query parameter or path segment. URI encoding (encodeURI) leaves characters like / : ? & = untouched, since it's meant for encoding a whole URL that already has structure.

Is URL encoding the same as Base64?

No, they're often confused but are different techniques. URL encoding (percent-encoding) replaces unsafe characters with %XX sequences and keeps most ASCII text readable, while Base64 re-encodes the entire input into a compact alphabet — you'd use URL-safe Base64 for a different purpose, like embedding binary data in a URL.

Does this tool send my URLs to a server?

No. Encoding and decoding happen entirely in your browser, so nothing you paste here is transmitted anywhere.

What is double encoding and how do I spot it?

It's a mistake where an already-encoded string gets encoded again — the % character itself turns into %25, so %20 becomes %2520. The telltale sign is sequences like %25XX in the decoded result.

Why is a space sometimes encoded as + and sometimes as %20?

+ for a space is the application/x-www-form-urlencoded format used by forms and query strings. %20 is standard percent-encoding from RFC 3986, valid anywhere in a URL.

Articles: Encoding

Base64: why encoding is needed and how it works

How Base64 turns binary data into ASCII text and where that is actually needed.

Base32: how it differs from Base64 and when it is more convenient

The case-insensitive Base32 alphabet and scenarios where it beats Base64.

HTML Entities: how to safely output special characters on a page

Why the characters < > & need escaping and how that prevents broken markup.

JWT: token structure and what "decoding" a JWT actually means

The header, payload, and signature of a JWT, and why decoding is not the same as verifying the signature.

Unicode Escape: what \uXXXX sequences mean

Where \u0041-style sequences in JSON and JS strings come from and what they mean.

ROT13 and the Caesar cipher: simple character substitution

Why shifting by 13 letters makes ROT13 self-inverse, and why anyone still uses it today.

Punycode: how internationalized domains work in DNS

How a domain with non-Latin characters gets converted into an ASCII form with the xn-- prefix.

Morse code: how text becomes dots and dashes

The principle behind encoding letters as dots and dashes, and where Morse code is still used today.

Data URI: when to embed images directly in code

How a data: URI embeds a file’s contents directly in HTML or CSS, and when that is worth it.

Gzip + Base64: compressing data for text-based transfer

Why compressed binary data also gets Base64-encoded before going into a text field.

XML Entities: escaping characters in XML documents

The five required XML entities without which a document breaks during parsing.