URL Encoder and Decoder

Encode text for safe use in URLs (percent-encoding) or decode it back. Essential for query parameters and links.

What URL encoding is

URL encoding, also called percent-encoding, replaces characters that are not safe in a web address with a percent sign followed by a code. A space becomes %20, an ampersand becomes %26, and so on. This lets you put any text — spaces, accents, symbols — into a URL without breaking it. This tool encodes text for safe use in URLs and decodes percent-encoded text back to readable form.

Why it is necessary

URLs have a limited set of characters they can safely contain. When you put a search term, a parameter value or a path segment that includes spaces, slashes, question marks or non-English letters directly into a URL, those characters can be misinterpreted and break the link. Encoding converts them into a safe representation that servers and browsers decode correctly. Anyone building query strings, API calls or links programmatically needs this constantly.

Encoding and decoding

Encoding takes readable text and makes it URL-safe — essential when you are constructing a link or a query parameter. Decoding does the reverse, turning a percent-encoded string back into readable text, which is useful when you are reading a URL someone sent you, debugging an API call, or inspecting what a parameter actually contains. This tool does both with one click each and handles accented and non-English characters correctly through UTF-8.

Common situations

Building a search URL where the query contains spaces and symbols. Passing a value that includes an ampersand or equals sign through a query parameter without breaking the URL structure. Reading a long, encoded URL to understand what it points to. Constructing API requests where parameters must be encoded. Because it runs in your browser, you can safely encode or decode values that contain sensitive data.

What URL encoding is

URL encoding, also called percent-encoding, replaces characters that are unsafe or reserved in a URL with a percent sign followed by two hexadecimal digits. A space becomes %20, an ampersand becomes %26, and so on. URLs are limited to a small set of ASCII characters by the RFC 3986 standard, so anything outside that set — spaces, accents, emoji, or reserved symbols like ? & = # when used as data — must be encoded to travel from browser to server without breaking the URL's structure.

encodeURI versus encodeURIComponent

JavaScript offers two encoding functions, and choosing wrong is a common bug. encodeURIComponent encodes everything reserved and is what you want for individual values you put into a query string — a search term, a parameter value, a redirect target. encodeURI preserves URL structure characters like / ? & = and is meant for encoding a whole URL while keeping it functional. The rule of thumb: use encodeURIComponent for the values inside a URL, and encodeURI only for an entire URL. This tool encodes components, which is what you need most of the time.

Common URL encoding mistakes

Two bugs dominate. Double-encoding happens when you encode a string that is already encoded — %20 becomes %2520 — which breaks the link; only encode raw text, never an already-encoded URL, and decode first if you are unsure. The other is the plus-sign ambiguity: in a query string, + can mean a space (from HTML form encoding), but in a URL path it is a literal plus. When in doubt, use %20 for a space, which is unambiguous everywhere. Also remember that an unencoded & inside a value will be misread as a parameter separator, splitting your data.

Frequently asked questions

What is the difference between URL encoding and Base64?
URL encoding makes text safe for web addresses by percent-encoding unsafe characters. Base64 is a different encoding for making binary data text-safe. They serve different purposes and are not interchangeable.
Why does a space become %20?
Spaces are not allowed in URLs, so encoding replaces them with %20, a safe representation that browsers and servers decode back to a space. Some contexts use a plus sign instead.
Does it handle accented and non-English characters?
Yes. The tool encodes through UTF-8, so accented letters and characters from any language are encoded and decoded correctly.
When would I decode a URL?
When you want to read what an encoded URL or parameter actually contains — useful for debugging API calls, inspecting links, or understanding a long encoded address someone sent you.
Is my data private?
Yes. Encoding and decoding happen in your browser with no upload.
What is the difference between URL encode and decode?
Encoding converts unsafe characters into percent-codes (a space becomes %20) so text is safe inside a URL. Decoding reverses it, turning %20 back into a space for display. Use encode to build a URL, decode to read one.
When should I use encodeURIComponent versus encodeURI?
Use encodeURIComponent for individual values inside a URL, like query parameter values — it encodes everything reserved. Use encodeURI only for a whole URL you want to keep functional, since it preserves structure characters like / ? & =.
Why did my URL get %2520 in it?
That is double-encoding: an already-encoded string was encoded again, so the % in %20 became %25. Only encode raw text, never an already-encoded URL. If unsure, decode first, then encode once.
Should I encode a space as %20 or +?
%20 is the standard and works everywhere. The + only means a space in query-string form data, and is a literal plus in a URL path. When in doubt, use %20.