URL Encode / Decode

Encode text for safe use in a URL, or decode a URL-encoded string back to plain text.

Why URL encoding matters

URLs can't contain certain characters like spaces, ampersands, or question marks without ambiguity — encoding converts these into a safe percent-escaped format (e.g. a space becomes %20).

URL encoding vs. other encoding methods

URL encoding (percent-encoding) specifically escapes characters that have special meaning within a URL, like spaces, ampersands, and question marks, while leaving most other text readable — unlike Base64, which re-encodes the entire string into a different character set.

This distinction matters when building or debugging URLs, API requests, or web forms, where knowing exactly which encoding a system expects prevents broken links or malformed requests.

A worked example

The text "hello world & friends?" encodes to "hello%20world%20%26%20friends%3F" — spaces become %20, the ampersand becomes %26, and the question mark becomes %3F.

Decoding "search%3Fq%3Dcalculators%26page%3D2" returns "search?q=calculators&page=2" — restoring the original query string characters that URL encoding had escaped for safe transmission.

Characters that require URL encoding

Certain characters have special meaning in URLs and must be encoded to be used safely as data — spaces, ampersands (&), question marks (?), and slashes (/) are among the most common characters that need encoding when they appear as part of a value rather than URL structure.

This matters most when building URLs programmatically or passing user-generated text (like a search query) as part of a link — failing to encode special characters can break the URL or cause it to be misinterpreted.

Frequently asked questions

What's the difference between this and Base64?

URL encoding escapes only the specific characters unsafe in URLs, keeping most text readable. Base64 re-encodes the entire string into a different character set.

When should I use URL encoding instead of Base64?

Use URL encoding when embedding text directly into a URL's query string or path, where readability and minimal character escaping matter. Base64 is better suited for encoding binary data or when a fixed-format string is needed.

Why do spaces become %20 or + in URLs?

Both represent an encoded space — %20 is the standard percent-encoding, while + is a legacy convention specifically used within URL query strings (form submissions), not the URL path itself.

What happens if I don't encode special characters in a URL?

The URL may break, get truncated, or be misinterpreted by the receiving server, since characters like spaces, ampersands, and question marks have structural meaning in URL syntax.

Related calculators