Turn messy text into clean, safe URLs in a single click. Works instantly in your browser — nothing is ever sent to a server.
Client-side · UTF-8 · Private · Instant
Your encoded output will appear here
Type or paste text on the left to start
Definition
URL encoding — also called percent-encoding — is a way to make sure text travels safely through a web address. Here's the deal: URLs can only carry a very specific set of characters (letters, numbers, and a handful of symbols like hyphens and underscores). If you try to stick a space, an ampersand, or a non-English character directly into a URL, things break. Browsers choke, servers misread the request, and your data gets lost or corrupted.
So URL encoding steps in. It takes any character that's "unsafe" for a URL and swaps it out for a percent sign followed by two hexadecimal digits — the character's ASCII code in hex. A space, for example, becomes %20. An ampersand becomes %26. A question mark becomes %3F.
This isn't some obscure hack — it's a global standard defined in RFC 3986, and it's what every browser, server, and API on the planet relies on to communicate cleanly.
Use Cases
You need URL encoding any time you're passing text through a URL that might contain characters the URL format doesn't naturally support. That sounds narrow, but it comes up all the time.
The Mechanics
Under the hood, the process is straightforward. The browser (or this tool) looks at each character in your string. If it's a safe character — a letter (A–Z, a–z), a digit (0–9), or one of the four unreserved symbols (hyphen, underscore, period, tilde) — it passes through unchanged. Everything else gets converted to its UTF-8 byte sequence, and each byte is represented as %XX where XX is the byte's value in hexadecimal.
→ %20→ %26→ %3D→ %3F→ %2F→ %23→ %40→ %2B→ %3A→ %22Capabilities
Your text gets encoded the moment you start typing. No button to click, no waiting — just instant results as you go.
Uses JavaScript's built-in encodeURIComponent, the most widely compatible encoding function for query parameters and form values.
Everything runs locally in your browser. Your text never leaves your device, never touches a server, never gets stored anywhere.
Hit Copy and the encoded string lands straight on your clipboard, ready to paste wherever you need it.
Handles any character — Chinese, Arabic, accented letters, symbols, and even emojis all get properly encoded to their UTF-8 percent sequences.
See the input and output character counts side by side so you know exactly how much your string grew after encoding.
Step-by-Step
Drop the raw text, URL, or query string you want to encode into the left panel. It can be anything — a search phrase, a file path, an entire URL, or raw JSON.
The right panel updates in real time as you type or paste. Every space, special character, and non-ASCII character is immediately replaced with its percent-encoded equivalent.
Click the Copy button to grab the encoded string to your clipboard, then paste it directly into your API request, redirect URL, form, or wherever it needs to go.
Deep Dive
This is probably the most common question developers have about URL encoding. Both functions exist in JavaScript and both do percent-encoding, but they cover different scenarios.
encodeURIComponent is designed for encoding individual pieces of a URL — a query parameter value, a form field value, or anything you're inserting as data inside a URL. It's aggressive: it encodes everything that isn't a letter, a number, or one of four unreserved characters. That's what this tool uses, and it's what you should reach for almost every time.
encodeURI, on the other hand, is for encoding a complete, already-formed URL. It's gentler — it leaves characters like /, ?, =, &, #, and : alone because those have structural meaning in a full URL. If you encode a full URL with encodeURIComponent, those structural characters will get encoded too and the URL will break.
The rule of thumb is simple: if you're encoding a value that goes inside a URL (like a query parameter), use encodeURIComponent (or this tool). If you're encoding a fully formed URL to make it safe as a whole unit, use encodeURI.
| Char | component | URI |
|---|---|---|
| Space | %20 | %20 |
| / (Slash) | %2F | / |
| ? (Question) | %3F | ? |
| & (Ampersand) | %26 | & |
| = (Equals) | %3D | = |
| # (Hash) | %23 | # |
| @ (At Sign) | %40 | @ |
FAQ
Everything you wanted to know about URL encoding but were afraid to ask.
URL encoding is a method for converting characters that aren't allowed in URLs into a safe format. URLs are restricted to a specific set of ASCII characters. When you need to pass data through a URL that contains spaces, symbols, or non-English characters, those characters have to be replaced with a percent sign followed by their two-character hexadecimal code. It exists because the URL standard (RFC 3986) predates Unicode and was designed with a very narrow character set in mind. Every browser, server, and API in the world uses this convention.
More Utilities
Got a URL full of %20s and %26s? Paste it here and get clean, readable text back in one click.
Build properly formatted UTM tracking URLs for your marketing campaigns without typing a single percent sign.
Format, validate, and minify JSON so it's always clean and correct before you pass it as a URL parameter.
Need a different kind of encoding? Base64 is perfect for binary data and file contents in URLs.
If you have a messy, percent-encoded URL full of % signs and hex codes, our URL Decoder will convert it back to plain, readable text in seconds.