URL Encoder/Decoder

Encode text for safe use in a URL or query string, or decode a percent-encoded URL back to readable text — all in your browser.

Type or paste something above, then Encode or Decode.

How it works

1

Paste text or a URL

A search term, a filename, a full query string — anything you need to encode or decode.

2

Encode or decode

Uses encodeURIComponent/decodeURIComponent, the same functions browsers use internally.

3

Copy the result

Malformed percent-encoding shows a clear error instead of a wrong or broken result.

What people use a URL encoder for

Anything going into a URL that isn't plain ASCII letters and digits usually needs encoding first.

Building search query URLs

Sharing links with special characters

Debugging API request parameters

Reading raw server access logs

Encoding redirect URLs

A few things worth knowing

A URL can only safely contain a limited set of ASCII characters. Anything outside that set — spaces, accented letters, emoji, punctuation like &, =, ? and # — has to be percent-encoded as %XX, where XX is the hex value of that character's byte, or it risks being misread as part of the URL's own structure (a raw & inside a value, for instance, would look like the start of the next query parameter).

This tool encodes and decodes a single value at a time using encodeURIComponent/decodeURIComponent, the same functions browsers use for query parameters, not encodeURI, which is meant for a complete URL and deliberately leaves structural characters like / and : untouched. If you paste a whole URL here and encode it, expect the slashes and colon to be escaped too — that's expected behavior for encoding a value, not a bug.

Decoding a malformed percent-encoded string — a stray % not followed by two hex digits, most commonly — throws a real error in JavaScript's decodeURIComponent. This tool catches that and shows you specifically what went wrong instead of failing silently or crashing.

Frequently asked questions

What does URL encoding actually do?

URL encoding (also called percent-encoding) replaces characters that aren't safe inside a URL — spaces, &, =, ?, #, and anything outside the basic ASCII letters/digits — with a % followed by two hex digits representing that character's byte value. It lets you put arbitrary text, including spaces and non-English characters, inside a URL or query string without breaking its structure.

Why does decoding sometimes fail?

Decoding fails when the percent-encoding is malformed — a % not followed by exactly two valid hex digits, or a truncated sequence at the end of the string. A literal % that was never meant to start an escape sequence (like in "50% off") is the most common cause; it needs to be encoded as %25 to be decoded safely.

Should I encode a whole URL or just part of it?

Usually just the value you're inserting — a search term, a filename, a single query parameter — not the whole URL including https:// and the slashes. This tool uses encodeURIComponent's behavior, which escapes everything except a small set of characters considered safe (letters, digits, - _ . ~), so it's meant for encoding one component or value at a time, not a complete URL structure.

What's the difference between encodeURIComponent and encodeURI?

encodeURI (used for encoding a full URL) leaves characters like / : ? & = alone because they're structurally meaningful in a complete URL. encodeURIComponent (what this tool uses) escapes those too, since it assumes you're encoding a single value that will be inserted into a URL, not the URL's own structure — this is almost always what you want for a query parameter or path segment.

Is URL encoding reversible without losing information?

Yes. Percent-encoding is a lossless, deterministic transformation — decoding a correctly encoded string always returns exactly the original text, including any special characters, emoji, or non-English text it contained.

Is this URL encoder free to use?

Yes, completely free, with no account, no sign-up, and everything computed locally in your browser.