URL Encoder / Decoder
Online URL encoder and decoder for query strings, paths, and HTTP request values - percent-encodes characters with encodeURIComponent.
Reviewed by Aygul Dovletova · Last reviewed
How to Use the URL Encoder/Decoder
- Pick a direction - choose "Encode" to turn raw text into a percent-encoded URL-safe string, or "Decode" to reverse a percent-encoded string back into readable characters.
- Paste your input into the text area. Results update live, so there is no separate submit button.
- Select the scope: leave Component mode on to encode a single query value or path segment, or enable Full URL mode when the input is an entire address whose structure you want to keep intact.
- Copy the result with the copy button, or tap Swap to pipe the output back into the input for the reverse conversion.
About URL Encoding
URL encoding, also known as percent encoding, is defined in RFC 3986 and exists because URLs are restricted to a small subset of ASCII. Many characters are either reserved (they have a structural meaning in a URL, such as /, ?, #, and &) or unsafe (such as spaces, quotes, and control bytes). To carry those characters inside a URL, the encoder replaces each byte with a percent sign followed by two hexadecimal digits, so that a space becomes %20 and an ampersand becomes %26.
When the input contains characters outside ASCII, the encoder first converts them to UTF-8 bytes and then percent-encodes each byte individually. A single emoji can therefore expand to twelve or more characters in the output. Decoding reverses this process byte-for-byte and reassembles the UTF-8 sequence.
JavaScript exposes two encoders with deliberately different rules: encodeURI preserves the characters that give a URL its shape, while encodeURIComponent escapes them all. Picking the wrong one is a common source of broken query strings and double-encoding bugs.
Encode URL
To encode a URL online, paste the raw string and let the encoder convert each unsafe character to its percent-encoded form. This online URL encoder takes any input - a query value, a path segment, a redirect target - and produces a URL-safe equivalent in the browser. Common entry points searchers use for this same operation include "url encode online", "online url encoder", "encode url string", "url encode text", and "convert string to url"; they all describe the same flow that the Encode mode covers above.
- Encoding a query value:
cats & dogsbecomescats%20%26%20dogsso the ampersand stops splitting the parameter. - Encoding a redirect target:
https://app.example.com/cb?u=1placed inside another URL must be percent-encoded so its?and=are not eaten by the outer query string. - Encoding a filename: a user-supplied title with spaces or quotes encodes cleanly so it can be used as a CDN key or download filename.
Decode URL
To decode a URL online, paste a string that already contains percent escapes (%XX) and switch to Decode mode. The tool reverses each escape back to its original byte and reassembles UTF-8 sequences when the input contained non-ASCII characters. The same operation is searched as "decode url online", "decode encoded url", "url decode encode", and "decode encode url"; the Decode direction handles all of them. Run Decode twice if the input was double-encoded - you will see one layer of % peeled per pass.
- Decoding a Cyrillic value:
%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82reconstructs into the word privet because each pair of hex digits is one UTF-8 byte. - Decoding a tracking URL: a long string with
%2F,%3A, and%3Fturns back into the readable original so you can audit where the redirect points. - Decoding form data: input encoded as
application/x-www-form-urlencodedcan be decoded here, but spaces show as+rather than%20and need a manual+-to-space pass.
HTTP Encoder
The terms HTTP encode and HTTP encoder are commonly used to mean URL/percent encoding inside HTTP requests, since URLs and query strings travel over HTTP. This tool acts as a free HTTP encoder for any portion of an HTTP message that needs URL-safe escaping: the request line, query parameters, Location header values, and form bodies. Whenever you build an HTTP request by hand - in curl, in fetch, or in a Postman script - run user input through this encoder so reserved characters do not corrupt the request.
Note that "HTTP encoding" sometimes also refers to transfer encoding (gzip, deflate, br) or content encoding. Those are separate concepts handled by the server and the browser automatically. This page only covers character-level URL/percent encoding, which is the meaning behind virtually all "encode http" and "http encoder" search queries.
URI Encode vs URL Encode
"URI encode" and "URL encode" are usually treated as synonyms. URI is the broader spec (RFC 3986) and URL is a specific kind of URI - the encoding rules are the same percent-encoding rules. Searches like "uri encode decode" and "url encoding converter" land on the same operation: replace bytes that are illegal in a URI with %XX escapes. The only meaningful distinction is which JavaScript helper to call:
encodeURIComponentis the right call for a single value (a query parameter, a path segment, a fragment piece) because it escapes every reserved character.encodeURIis the right call for a complete address (already-formed URL) because it preserves the structural delimiters: / ? # & =.- Both produce uppercase hex digits and percent escapes that are byte-identical to a server-side URL/URI encoder, so the output is interoperable.
Examples
- The phrase
hello worldencodes tohello%20worldbecause the space is not a legal URL character. - The search query
cats & dogsbecomescats%20%26%20dogsin Component mode, safely escaping the ampersand that would otherwise split a query string. - The Cyrillic word
приветbecomes%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82- each pair of hex digits represents one UTF-8 byte.
When to Use URL Encoding
- Building a query-string parameter that may contain spaces, ampersands, or equals signs.
- Embedding a redirect target URL inside another URL (for OAuth
redirect_urior tracking links). - Constructing REST API paths where a path segment contains a slash, colon, or user input.
- Encoding a fragment identifier (the part after
#) that contains reserved characters. - Preparing form data before a manual
fetchrequest withapplication/x-www-form-urlencoded. - Producing safe filenames derived from user-supplied titles or URLs.
Frequently Asked Questions
What is URL encoding and why is it needed?
URL encoding, also called percent encoding, is a scheme defined in RFC 3986 that replaces characters not allowed in a URL with a percent sign and two hexadecimal digits representing a byte. URLs may only contain a small ASCII subset because reserved characters like <code>?</code>, <code>&</code>, and <code>#</code> carry structural meaning. Without encoding, a space or question mark inside a query value would break the URL or be interpreted as part of its structure.
What is the difference between encodeURI and encodeURIComponent?
<code>encodeURI</code> is meant for a complete URL. It preserves structural characters such as <code>:</code>, <code>/</code>, <code>?</code>, <code>#</code>, <code>&</code>, and <code>=</code> so the address stays parseable. <code>encodeURIComponent</code> is meant for a single value that will be dropped into a URL, so it escapes every reserved character. Use Component mode for a query parameter value, and Full URL mode only when the input is already a well-formed address you want to preserve.
Why do I sometimes see + instead of %20 for spaces?
The <code>+</code> character for spaces comes from the <code>application/x-www-form-urlencoded</code> MIME type, which HTML forms use when they <code>POST</code> or serialize their data into a query string. It is subtly different from RFC 3986 percent encoding, which always uses <code>%20</code> for a space. This tool produces <code>%20</code> so the output is safe inside URL paths, fragments, and headers. Convert manually when targeting form-encoded bodies.
Is my input uploaded to a server?
No. Encoding and decoding happen entirely in your browser with the built-in JavaScript functions <code>encodeURI</code>, <code>encodeURIComponent</code>, <code>decodeURI</code>, and <code>decodeURIComponent</code>. Nothing is sent to our servers, nothing is logged, and nothing is cached outside the current tab. You can safely process URLs that contain tokens, session IDs, or any other sensitive fragments you would not want to leak to a third party.
Can I encode emoji, Chinese, or other non-ASCII characters?
Yes. Non-ASCII characters are first converted to their UTF-8 byte sequence and then each byte is percent-encoded individually. A single emoji such as 🎉 becomes a chain of four percent-escapes because its UTF-8 representation is four bytes long. Decoding reverses the process and reconstructs the original characters exactly. Double-encoding (running encode twice) is a common bug - check the result starts with a single <code>%</code> per byte.
Why does encoding the same URL produce different output in different tools?
Different tools default to different functions. A URL-builder that uses <code>encodeURI</code> keeps slashes and query delimiters intact, while one that calls <code>encodeURIComponent</code> escapes them as <code>%2F</code>, <code>%3F</code>, and so on. Some tools also use form encoding where <code>+</code> replaces spaces. None of the outputs is wrong, but they serve different layers: a whole URL versus a single value within a URL.
What are reserved versus unreserved characters in a URL?
RFC 3986 splits URL characters into two sets. <em>Unreserved</em> characters - letters, digits, and <code>- _ . ~</code> - never need to be encoded. <em>Reserved</em> characters have a structural role: <code>: / ? # [ ] @</code> are general delimiters and <code>! $ & ' ( ) * + , ; =</code> are subcomponent delimiters. Whether they need encoding depends on context. Inside a query value they must be percent-encoded; inside the path structure they should usually stay literal.
Are there length limits on a URL or on this tool's input?
This tool itself has no artificial cap; it will happily encode strings many megabytes long in the browser. Real-world URLs, however, are limited by servers and browsers. Most web servers reject requests with URLs longer than around 8 to 16 kilobytes, and some older browsers cap individual URLs at 2 kilobytes. For payloads beyond that, send data in a <code>POST</code> body instead of cramming it into a query string.
Is "URI encode" the same thing as "URL encode"?
In day-to-day use, yes. URI is defined by RFC 3986 and URL is a kind of URI, so the percent-encoding rules are identical. The JavaScript helpers carry the URI label (<code>encodeURI</code>, <code>encodeURIComponent</code>) but they implement exactly the URL/percent-encoding scheme that web servers, query strings, and HTTP headers expect. Searches for "uri encode decode" and "url encode decode" map to the same operation this tool performs.
How do I encode a string for use in a URL?
Paste the raw string into the input box, leave the mode on Component (which calls <code>encodeURIComponent</code>), and copy the output. The result is safe to drop into a query parameter value, a path segment, or a fragment piece without breaking the surrounding URL. If the string is itself a complete address you want to preserve, switch to Full URL mode (which calls <code>encodeURI</code>) so the structural characters stay intact.
How do I decode an encoded URL back to readable text?
Switch to Decode mode and paste the URL or fragment. The tool replaces every <code>%XX</code> escape with the original byte and reassembles UTF-8 sequences for non-ASCII characters. If the input was encoded twice (you will see <code>%25</code> instead of <code>%</code>), run Decode again to peel the second layer. The decode runs in your browser using <code>decodeURIComponent</code> or <code>decodeURI</code>, with no network round trip.
What is an HTTP encoder and how is it different from a URL encoder?
In practice, "HTTP encoder" is just another name for a URL/percent encoder. URLs and query strings travel over HTTP, so encoding bytes for an HTTP request is the same operation as encoding them for a URL. This tool covers that case directly. The unrelated meaning of "HTTP encoding" - <em>transfer encoding</em> like gzip or br - is handled automatically by your client and server and is not what this tool produces.
Online URL encoder vs an offline tool: which is safer?
A trustworthy online URL encoder runs entirely client-side, the same way an offline tool would. This page is one of those - the encode and decode functions execute in the JavaScript engine of your browser, your input never leaves your device, and there is no analytics event that captures the input text. If you want to verify, open DevTools, switch to the Network tab, and watch traffic while you encode: there will be no outbound requests carrying the value.
More Developer Tools
Base64 Encoder & Decoder
Encode UTF-8 text to Base64 online or decode Base64 back to UTF-8 and plain text. Runs in your browser with no upload.
Open toolBulk URL Encode / Decode
Encode or decode many URLs at once. Paste a newline-separated list and the tool processes each line in parallel, preserving order and blank lines.
Open toolCode Screenshot
Create beautiful code snippet images with customizable themes.
Open toolColor Converter
Convert colors between HEX, RGB, HSL and CMYK formats.
Open toolCron Expression Parser
Parse cron expressions into human-readable schedules with next run times.
Open toolCSS Formatter / Minifier
Format, beautify and minify CSS code.
Open tool