Skip to content
Q3.Labs, Home

Free Tool

URL Encoder & Decoder

Encode or decode URLs and URI components with standard percent-encoding, and choose between encoding a single value or a complete URL. Your URL or text is processed locally in your browser and is not uploaded to Q3 Labs.

  • Free
  • · No signup
  • · Nothing uploaded
  • · Unicode and emoji safe

Private by design. Your URL or text is processed locally in your browser and is not uploaded to Q3 Labs. URLs you enter are never opened or fetched.

Operation

Encoding type

Uses encodeURIComponent()

URI Component encodes everything except letters, digits and - _ . ! ~ * ' ( ). Use it for a single value, such as one query parameter or path segment.

0 characters

Tip: press Ctrl+Enter (Cmd+Enter on Mac) to run.

Result

Encode or decode something to see the result details here.

Free URL encoder and decoder online

This tool percent-encodes and decodes text for use in URLs. Choose Encode or Decode, then choose what you're working with: a single URI Component (such as one query parameter value) or a Full URI. The tool shows exactly which JavaScript function it used, how the length changed, and warns about common mistakes such as double encoding.

Everything is treated as text. A URL you paste is never opened, fetched or checked online. To see what a live URL actually returns, use the HTTP Status Checker instead.

What is URL encoding?

URLs can only contain a limited set of ASCII characters, and some of those, such as ?, & and /, have special jobs. URL encoding lets you include anything else (spaces, symbols, other languages, emoji) and lets you use a special character as ordinary data without changing the URL's meaning.

What is percent encoding?

Percent-encoding is the mechanism defined in RFC 3986: a byte is written as % followed by its value in two hexadecimal digits. A space (byte 32, hex 20) becomes %20; an ampersand becomes %26. "URL encoding" and "percent encoding" describe the same thing.

How URL encoding works

  1. Characters that are safe as they are stay unchanged: letters, digits and a few symbols like - _ . ~
  2. Everything else becomes bytes. The character is converted to UTF-8: one byte for ASCII, two to four for other scripts and emoji.
  3. Each byte is written as %XX in hexadecimal. So é becomes %C3%A9 and 🚀 becomes %F0%9F%9A%80.
  4. Structural characters depend on context. Whether / or & is encoded depends on whether it's part of the URL's structure or part of the data.

URL encoding vs URL decoding

Encoding turns text into its URL-safe form, for example before you put a search term into a link. Decoding turns percent-encoded text back into readable characters, for example to read a value from a link or a server log. For valid input they are exact opposites: decoding what you encoded gives back the original, which you can check with the tool's Swap button.

encodeURI vs encodeURIComponent

JavaScript has two pairs of built-in functions, and they exist for different jobs:

  • encodeURIComponent() / decodeURIComponent() handle one piece of a URL. They encode the structural characters too, so the piece can't break the URL it goes into. This is the URI Component mode.
  • encodeURI() / decodeURI() handle a complete URL. They leave its structure alone and only encode what can never appear literally, such as spaces. decodeURI() also deliberately keeps escapes like %2F and %3F, so decoding can't change the URL's structure. This is the Full URI mode.

Here is the same URL through both:

A complete URL encoded with encodeURI and encodeURIComponent
FunctionResult for https://example.com/search?q=hello world&lang=en
encodeURIhttps://example.com/search?q=hello%20world&lang=en
encodeURIComponenthttps%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3Den

The first is still a working link; only the space was encoded. The second encoded the :, /, ?, = and & as well. That is correct if this whole URL is being passed as a value inside another URL (for example ?redirect=…), and wrong if you just wanted a usable link.

When should you encode a URL component?

  • Query parameter values built from user input, search terms or data.
  • Query parameter names if they can contain anything beyond letters and digits.
  • Path segments built from data, such as a product name, so a / in the data doesn't create a new folder level.
  • A whole URL passed as a value, such as a redirect or share target.

Don't encode a whole, already-structured URL with component encoding, and don't encode a value twice. Build the URL from encoded pieces instead. If you're building campaign links, the UTM Builder encodes each parameter for you.

How to encode query parameters

Encode each value on its own, then assemble the URL. For the search term hello world & SEO:

  1. Encode the value with URI Component mode: hello%20world%20%26%20SEO
  2. Add it after the parameter name: https://q3labs.co/search?q=hello%20world%20%26%20SEO

Because the & became %26, the server reads the whole phrase as the value of q. Left unencoded, & SEO would look like the start of a second parameter. Encoding https://q3labs.co/search?q=hello world as a whole with Full URI gives https://q3labs.co/search?q=hello%20world, which only fixes the space.

URL encoding examples

These results are produced by the same code the tool above uses.

Text encoded as a URI component and as a full URI
ExampleInputURI ComponentFull URI
Spaceshello worldhello%20worldhello%20world
Ampersand and equalsa&b=ca%26b%3Dca&b=c
Reserved characters: / ? # [ ] @%3A%20%2F%20%3F%20%23%20%5B%20%5D%20%40:%20/%20?%20#%20%5B%20%5D%20@
Plus and percent1+1 = 100%1%2B1%20%3D%20100%251+1%20=%20100%25
Hindiनमस्ते दुनिया%E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87%20%E0%A4%A6%E0%A5%81%E0%A4%A8%E0%A4%BF%E0%A4%AF%E0%A4%BE%E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87%20%E0%A4%A6%E0%A5%81%E0%A4%A8%E0%A4%BF%E0%A4%AF%E0%A4%BE
Arabicمرحبا بالعالم%D9%85%D8%B1%D8%AD%D8%A8%D8%A7%20%D8%A8%D8%A7%D9%84%D8%B9%D8%A7%D9%84%D9%85%D9%85%D8%B1%D8%AD%D8%A8%D8%A7%20%D8%A8%D8%A7%D9%84%D8%B9%D8%A7%D9%84%D9%85
Japaneseこんにちは%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF
Emoji🚀 Q3 Labs%F0%9F%9A%80%20Q3%20Labs%F0%9F%9A%80%20Q3%20Labs

Spaces, plus signs and %20

In percent-encoding a space is always %20, and that is what encodeURIComponent() and encodeURI() produce. You will also see + used for spaces. That comes from a related but different format, application/x-www-form-urlencoded, which HTML forms and URLSearchParams use for query strings.

  • In a query string, most servers read both + and %20 as a space.
  • In a path, + is just a plus sign, so %20 is the safe choice.
  • A literal plus sign in a value must be encoded as %2B, or a form-style decoder will turn it into a space.

This tool follows the URI standard, so it never turns spaces into + and never decodes + as a space.

Reserved characters in URLs

The URI standard reserves these characters for structure: : / ? # [ ] @ separate the main parts of a URL, and ! $ & ' ( ) * + , ; = are available as delimiters within them. A reserved character doesn't always have to be encoded. It depends on its role: the ? that starts a query string must stay as it is, while a ? inside a search term must be encoded. Here is what each function does with them:

Reserved characters encoded as a URI component and as a full URI
CharacterencodeURIComponentencodeURI
:%3A: (unchanged)
/%2F/ (unchanged)
?%3F? (unchanged)
#%23# (unchanged)
[%5B%5B
]%5D%5D
@%40@ (unchanged)
!!! (unchanged)
$%24$ (unchanged)
&%26& (unchanged)
''' (unchanged)
((( (unchanged)
))) (unchanged)
*** (unchanged)
+%2B+ (unchanged)
,%2C, (unchanged)
;%3B; (unchanged)
=%3D= (unchanged)

encodeURIComponent also leaves ! ' ( ) * unchanged, as the JavaScript specification defines, so strict RFC 3986 encoders may differ on those five characters.

URL encoding and Unicode

URLs are ASCII, so other characters are converted to UTF-8 bytes and each byte is percent-encoded. That is why one character can become a long run: न is %E0%A4%A8 (three bytes), and the rocket emoji is %F0%9F%9A%80 (four). Decoding reverses it exactly. Browsers often display the decoded form in the address bar while sending the encoded one.

If a decoder reports invalid UTF-8, a multi-byte character was usually cut off (for example %E0%A4 without its last byte), or the value was encoded with an old single-byte character set. This tool reports that instead of returning corrupted text.

Common URL encoding mistakes

  • Component-encoding a whole URL, which turns https:// into https%3A%2F%2F and breaks the link.
  • Double encoding: encoding an already-encoded value turns %20 into %2520. The tool warns when this looks likely.
  • Not encoding values at all, so an & or # in the data cuts the value short.
  • A literal % that isn't encoded, such as 100%, which decoders reject. Write it as 100%25.
  • Mixing + and %20 between form-style and URI-style code.
  • Treating encoding as security. Encoded values are trivially readable, and decoded input is still untrusted. URL encoding isn't encryption.

For payloads that need to carry binary data, see the Base64 Encoder & Decoder. Building links and redirects correctly also matters for SEO hygiene: an On-Page SEO Checker can confirm a page's canonical and links look right.

Frequently Asked Questions

What is URL encoding?

URL encoding, also called percent-encoding, replaces characters that aren't allowed or have a special meaning in a URL with a % sign followed by two hexadecimal digits. A space becomes %20, an ampersand becomes %26, and non-ASCII characters are first converted to UTF-8 bytes, each written as %XX.

What is URL decoding?

URL decoding reverses the process: every %XX sequence is turned back into the byte it represents, and the bytes are read as UTF-8 text. So hello%20world becomes hello world again.

What is percent encoding?

Percent-encoding is the formal name, from the URI standard (RFC 3986), for writing a byte as % plus two hex digits. "URL encoding" is the everyday name for the same thing.

What is the difference between encodeURI and encodeURIComponent?

encodeURI is for a complete URL: it leaves characters that give a URL its structure, such as : / ? # & =, untouched and encodes things like spaces and non-ASCII characters. encodeURIComponent is for one piece of a URL, such as a single query parameter value: it encodes those structural characters too, so the value can't break the URL around it.

Should I encode a complete URL?

Only with a full-URI encoding such as encodeURI (Full URI mode here), and usually only when the URL contains spaces or non-ASCII characters. Running encodeURIComponent over a whole URL turns https:// into https%3A%2F%2F and breaks it as a link. The exception is when the whole URL is itself a parameter value, for example a redirect target; then component encoding is exactly right.

Should I encode query parameters?

Yes. Encode each parameter name and value separately with encodeURIComponent (URI Component mode), then join them with = and &. That way an & or = inside a value can't be mistaken for the start of a new parameter.

Why does a space become %20?

A space isn't allowed in a URL, so it has to be escaped. Its character code is 32, which is 20 in hexadecimal, so percent-encoding writes it as %20.

Why doesn't encodeURIComponent use + for spaces?

Because + for a space isn't part of generic URI encoding. It comes from the HTML form format application/x-www-form-urlencoded, which browsers use when submitting forms and which URLSearchParams produces. encodeURIComponent follows the URI standard and always writes %20. In a query string both are usually understood, but in a path a + is just a plus sign.

What does %3F mean?

%3F is an encoded question mark (?). It lets a ? appear inside a value without starting the URL's query string.

What does %26 mean?

%26 is an encoded ampersand (&). Inside a query parameter value it stops the & from being read as the separator between two parameters.

What does %2F mean?

%2F is an encoded forward slash (/). It keeps a slash inside a single value, such as a path segment or parameter, from being read as a path separator.

Can URL encoding handle Unicode?

Yes. Characters outside ASCII are converted to UTF-8 bytes and each byte is percent-encoded, so é becomes %C3%A9 and 🚀 becomes %F0%9F%9A%80. Hindi, Urdu, Arabic, Chinese, Japanese and emoji all encode and decode correctly in this tool.

Is URL encoding encryption?

No. It is a reversible way of writing characters so they fit safely in a URL. Anyone can decode it, and it hides nothing.

Is URL encoding secure?

URL encoding is not a security measure. It prevents characters from being misread as URL syntax, which avoids a class of bugs, but it doesn't protect data. Never put secrets in URLs, and treat decoded values as untrusted input in your code.

Can I decode a URL online?

Yes, with this page. Choose Decode, pick URI Component to decode everything or Full URI to keep reserved characters encoded, paste the value and press Decode. Broken escapes such as a lone % or %ZZ are reported with their position.

Is this URL encoder free?

Yes. It is free, needs no account and has no usage limits apart from the input size a browser handles comfortably.

Does this tool send URLs to a server?

No. Your URL or text is processed locally in your browser and is not uploaded to Q3 Labs. The tool never opens or fetches the URLs you enter, and it doesn't put them in analytics, storage or the page address.

Explore more

Encode binary data or text for APIs with the Base64 Encoder & Decoder, turn page titles into clean URLs with the Slug Generator, format or shrink JSON with the JSON Formatter and JSON Minifier, and build tracked campaign links with the UTM Builder. Check a live URL with the HTTP Status Checker, generate a sitemap with the XML Sitemap Generator, and count or reformat text with the Character Counter and Case Converter. Browse all our free tools.

Keep exploring

Related services

  • Web DevelopmentSlow, hard-to-maintain websites quietly cap growth by hurting Core Web Vitals, SEO, and conversion rate.
  • Digital solutions for BankingBanks compete on trust, clarity and convenience, under strict rules about what they can say and do. We build…
  • Website RedesignA redesign is a different project than a new build. The goal is rarely a total rebuild, it's fixing what's ac…
  • Membership Website Development CostsWhat membership website development actually costs: pricing factors, typical ranges by feature set, and how i…
  • Web & App DevelopmentOff-the-shelf software forces your business to work around its limitations instead of the other way around.
  • WordPress Website DevelopmentCustom WordPress website development for businesses, portfolios, membership sites, online stores and e-learni…

Guides & articles

Tools

We use cookies for analytics to understand site usage. Privacy Policy