Tools

Home
Regex TesterHash GeneratorFavicon DownloaderEncrypt/DecryptJSON Path TesterFavicon Downloader

URL Encoder & Decoder

Encode or decode URLs and text instantly using encodeURIComponent or encodeURI

Your files never leave your browser
Input0 chars
Output0 chars
Ready·encodeURIComponent mode
Common URL-Encoded Characters Reference
CharacterEncodedDescription
(space)%20Space character
!%21Exclamation mark
#%23Hash / fragment
$%24Dollar sign
&%26Ampersand
+%2BPlus sign
/%2FForward slash
:%3AColon
;%3BSemicolon
=%3DEquals sign
?%3FQuestion mark
@%40At sign

Paste any URL or text, pick encode or decode, and get the percent-encoded (or decoded) version instantly — using the same encodeURIComponent and encodeURI functions browsers use under the hood. Switch between modes, swap input and output, or turn on live encoding that updates as you type. And everything runs in your browser. Nothing gets uploaded.

How It Works

Paste Text or URL
➔
Pick Encode or Decode
➔
Get Clean Output

URL encoding replaces characters that aren't allowed in URLs — things like spaces, brackets, and non-Latin characters — with a percent sign followed by two hex digits. A space becomes %20, a forward slash becomes %2F. Decoding reverses that process. The tool gives you two modes: encodeURIComponent (encodes almost everything, good for query parameter values) and encodeURI (leaves structural characters like / and : alone, good for full URLs).

Examples

Encoding a search query with spaces and symbols

You are building a Google search link and need the query string encoded properly.

INPUT
best coffee shops & cafés near me
OUTPUT
best%20coffee%20shops%20%26%20caf%C3%A9s%20near%20me

Decoding a tracking URL from an email campaign

A marketing link is full of encoded parameters and you need to read what it actually says.

INPUT
https%3A%2F%2Fexample.com%2Fpromo%3Futm_source%3Dnewsletter%26utm_medium%3Demail
OUTPUT
https://example.com/promo?utm_source=newsletter&utm_medium=email

Encoding a JSON payload for a GET request

Some APIs accept JSON as a query parameter. The curly braces, quotes, and colons all need encoding.

INPUT
{"name":"Jane Doe","city":"São Paulo"}
OUTPUT
%7B%22name%22%3A%22Jane%20Doe%22%2C%22city%22%3A%22S%C3%A3o%20Paulo%22%7D

Who Uses This

💻 Developers

Building API calls, debugging query strings, or constructing redirect URLs that pass data through parameters.

📈 Marketers

Reading UTM-tagged campaign links that look like a wall of percent signs to figure out what each parameter actually says.

🔎 QA Testers

Checking whether URLs with special characters — accents, CJK characters, symbols — survive the encoding round-trip correctly.

📚 Students

Learning how the web handles characters behind the scenes, especially for coursework on HTTP and web protocols.

Common Mistakes

Double-encoding a URL

You encode a string, then paste the result into another tool that encodes it again. Now %20 becomes %2520 and nothing works. Encode once. If your output already has percent signs, you probably don't need to encode it again.

Using encodeURI when you need encodeURIComponent

encodeURI skips characters like &, =, and / because it assumes you're encoding a full URL. If you are encoding a parameter value that contains those characters, use encodeURIComponent instead — otherwise the value bleeds into the URL structure.

Trying to decode a string that is not encoded

Feeding plain text into a decoder usually works fine — it just returns the same text. But if the text accidentally contains a % followed by two characters (like %GE), you will get a "malformed URI" error. Only decode strings that were actually percent-encoded.

Technical Details

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?

encodeURI is meant for encoding a complete URL. It leaves characters like :, /, ?, and & untouched because those are structural parts of a URL. encodeURIComponent encodes almost everything, which makes it the right choice when you're encoding a value that goes inside a query parameter. Wrong pick here is probably the most common encoding bug on the web.

Why do spaces sometimes become %20 and sometimes become +?

Two different specs. The %20 form follows RFC 3986 — that is what encodeURIComponent produces. The + form comes from the older application/x-www-form-urlencoded format used by HTML forms. Both mean "space," but they show up in different contexts. If you are building a query string by hand, %20 is the safer bet.

Is URL encoding the same as Base64 encoding?

Not at all. URL encoding replaces individual unsafe characters with percent-hex pairs — the output is still mostly readable. Base64 turns entire binary data into an ASCII string of letters, digits, +, and /. They solve different problems. URL encoding makes text safe for URLs; Base64 makes binary data safe for text-based systems like email or JSON.

Can I URL-encode an entire URL including the protocol?

You can, but you probably shouldn't — at least not with encodeURIComponent. That would turn https:// into https%3A%2F%2F, which breaks the URL structure. Use encodeURI if you want to encode a full URL while keeping the protocol and slashes intact. Use encodeURIComponent only for the individual pieces like parameter values.

Do I need to URL-encode letters and numbers?

No. Letters (A-Z, a-z), digits (0-9), and a handful of special characters (-, _, ., ~) are "unreserved" in RFC 3986 and never need encoding. Everything else — spaces, punctuation, accented letters, emoji — should be encoded when used in a URL.

Share: