How to Use This Percent Encoder
This percent encoder was designed around a single idea: you should never have to hunt for the button. The tool is already waiting for you at the top of the page, and it converts your text the moment you start typing. There is no submit button, no page reload, and no waiting.
- Choose Encode to turn plain text into a percent-encoded string, or Decode to turn a percent-encoded string back into readable text.
- Type or paste your text into the input box. The result appears instantly below.
- Hit Copy to send the result to your clipboard, Swap to flip the result back into the input in the opposite direction, or Clear to start over. Hover any chunk of the result to see exactly which character it came from, and find your last few conversions waiting under Recent conversions — stored only on your own device.
Because everything happens on your own device, the tool works just as well with a two-letter query as it does with a thousand-line block of encoded data, and it keeps working even on a flaky connection.
What Is Percent Encoding?
Percent encoding is the standard way the web represents characters that are not allowed to appear raw inside a URL. The mechanism, formally defined in RFC 3986, replaces each unsafe character with a percent sign followed by two hexadecimal digits that represent the character's byte value. A space becomes %20, an ampersand becomes %26, and a percent sign itself becomes %25.
You will also hear this called URL encoding, and the two terms are used interchangeably across documentation, browser dev tools, and programming languages. Whatever you call it, the goal is the same: making sure that data survives the trip from one system to another without being misread. A URL is not just an address — it is a structured piece of data with reserved punctuation, and percent encoding is how ordinary text is allowed to travel inside that structure without colliding with it.
Characters outside the basic ASCII set — accented letters, Chinese characters, Arabic script, emoji — go through an extra step. They are first converted into their UTF-8 byte sequence, and each byte is then encoded individually. That is why a single emoji can turn into a run of twelve hexadecimal digits. A good percent encoder handles all of this silently, which is exactly what the tool above does.
encodeURIComponent vs. encodeURI
The most common encoding mistake on the web is using the wrong scope. JavaScript exposes this distinction directly through two functions, and understanding the difference explains exactly how this percent encoder treats your text.
encodeURIComponent() encodes every reserved character, including /, ?, &, and =. This is the correct choice whenever you are encoding a value that will be placed inside a larger URL — a search term, a redirect target, an email address, a filename. If a user searches for "salt & pepper", the ampersand must be encoded, or the server will think a new parameter has started. This is the behavior the tool above follows, because it is the safe default for the vast majority of real-world tasks.
encodeURI(), by contrast, leaves the structural punctuation of a URL untouched and only encodes characters that are never legal, such as spaces and non-ASCII characters. It is meant for complete addresses whose slashes, colons, and question marks you want to keep. If you paste a full URL into this tool, those structural characters will be encoded too — so split the address up and encode only the dynamic values, then reassemble the URL around them.
Reserved Characters at a Glance
These are the characters with special meaning in a URL, along with their percent-encoded forms. This percent encoder escapes every one of them.
| Character | Encoded | Why it is reserved |
|---|---|---|
| space | %20 | Not allowed raw in URLs |
| ! | %21 | Sub-delimiter |
| # | %23 | Starts the fragment |
| $ | %24 | Sub-delimiter |
| % | %25 | Marks an encoded byte |
| & | %26 | Separates query parameters |
| ' | %27 | Sub-delimiter |
| + | %2B | Means a space in form data |
| , | %2C | Sub-delimiter |
| / | %2F | Separates path segments |
| : | %3A | Separates scheme and port |
| ; | %3B | Sub-delimiter |
| = | %3D | Joins keys and values |
| ? | %3F | Starts the query string |
| @ | %40 | Separates user info from host |
| [ | %5B | Wraps IPv6 hosts |
| ] | %5D | Wraps IPv6 hosts |
When You Actually Need a Percent Encoder
Most people land on a percent encoder in the middle of a specific task. If any of these sound familiar, you are in the right place.
- Building query strings. You are constructing a link like
?q=...and the value might contain spaces, ampersands, or equals signs that would corrupt the URL if left raw. - Debugging a broken link. A marketing URL full of
%20and%3Dis misbehaving, and you need to decode it to see what it actually says. - Localizing content. You are sharing links that contain non-English text and need them to survive email clients, chat apps, and analytics tools.
- Working with APIs. An endpoint rejects your request because a path segment or parameter was not encoded the way the server expected.
- Writing
mailto:links. Subject and body values need encoding so that spaces and line breaks reach the mail client intact. - Auditing for SEO. You are checking that canonical URLs and redirects use consistent, valid encoding.
Percent Encoding in Your Own Code
The tool above is perfect for quick conversions, but sometimes you need encoding inside a script. Here is the idiomatic way in the two languages developers reach for most.
JavaScript
// Encode a single query value
const q = encodeURIComponent("salt & pepper");
// "salt%20%26%20pepper"
// Encode a full URL but keep its structure
const url = encodeURI("https://example.com/my file.pdf");
// "https://example.com/my%20file.pdf"
// Decode again
decodeURIComponent(q); // "salt & pepper"Python
from urllib.parse import quote, unquote
quote("salt & pepper", safe="") # 'salt%20%26%20pepper'
unquote("salt%20%26%20pepper") # 'salt & pepper'The results you get from these snippets are identical to what this percent encoder produces in the matching mode, so you can use the tool to verify your code's output during debugging.
Frequently Asked Questions
Is percent encoding the same thing as URL encoding?
Yes. The two names describe the same mechanism defined by RFC 3986: any character that is not allowed in a URL is replaced by a percent sign followed by two hexadecimal digits. People who work with query strings tend to say URL encoding, while the formal specification calls it percent-encoding. This percent encoder handles both perspectives identically.
How does this percent encoder treat reserved characters?
The tool encodes every reserved character — including /, ?, &, =, and # — the same way JavaScript's encodeURIComponent() does. That is the safe choice for the most common job: preparing a single value, like a search term or an email address, to sit inside a larger URL without its punctuation breaking the surrounding structure.
Does this percent encoder support emoji and non-English characters?
Yes. The tool is fully UTF-8 aware. Emoji, accented letters, CJK characters, Arabic, Hebrew, and every other Unicode code point are first converted to their UTF-8 byte sequence and then percent-encoded byte by byte, exactly the way modern browsers do it.
Is it safe to paste sensitive text into this tool?
Yes. All encoding and decoding happens locally in your browser using JavaScript's built-in functions. Your input never leaves your device, is never sent to a server, and is never stored or logged. You can even disconnect from the internet after the page loads and the tool will keep working.
Why does decoding sometimes fail with an error?
Decoding fails when the input contains malformed percent sequences, such as a lone % sign, a sequence with only one hex digit like %2, or characters that are not valid hexadecimal. Check that every % is followed by exactly two hex digits (0-9, A-F) and try again.
Which characters never need to be percent-encoded?
RFC 3986 defines a set of unreserved characters that are always safe in any part of a URL: uppercase and lowercase letters, digits, and the four symbols hyphen (-), underscore (_), period (.), and tilde (~). Every other character may need encoding depending on where it appears.
A Percent Encoder That Respects Your Time
There are plenty of ways to encode a URL, but most of them ask for more attention than the task deserves. This percent encoder keeps the whole job on one screen: paste your text, copy the result. No accounts, no pop-ups, no artificial limits, and no server ever touching your data. Bookmark it once, and the next time a stubborn URL stands between you and a finished task, the fix is two clicks away.