URL Encoder

Percent-encode text for safe use in a URL — spaces, ampersands, slashes and any other special characters become %-codes. Uses encodeURIComponent, in your browser.

Developer Tools Free No upload Instant

Loading URL Encoder…

Your browser is preparing the tool. It runs 100% locally.

Quick Answer

Paste text and the tool percent-encodes it with the browser's encodeURIComponent, turning spaces, slashes, ampersands, question marks and other special characters into their %-codes so they travel safely inside a URL. It encodes a single piece — a query value — not a whole URL, so the slashes and colons of a full address get encoded too. Non-English letters become their UTF-8 %-bytes. It runs entirely in your browser.

What the URL Encoder Does

Type or paste a value and you get its percent-encoded form, ready to drop into a query string or path segment. A space becomes %20, a slash becomes %2F, an ampersand becomes %26 — anything with a special meaning in a URL is replaced by a percent sign and its hex code, so the value cannot break the link it sits in.

It encodes a component, not a complete URL. Because it escapes the reserved characters that separate the parts of a URL (the slashes, colon, question mark and ampersand), running a whole address through it encodes those separators too — which is exactly what you want for a single value, but not for a finished URL.

How It Works

The tool runs your text through JavaScript's encodeURIComponent. That leaves the unreserved characters untouched — the letters A to Z, the digits, and a few symbols (hyphen, underscore, dot, tilde, and also the exclamation mark, apostrophe, parentheses and star) — and percent-encodes everything else, including the reserved characters that have structural meaning in a URL.

Characters outside ASCII are first converted to their UTF-8 bytes, and each byte is encoded separately. So an accented é becomes %C3%A9 (two bytes), and an emoji becomes four %-codes. Decoding reverses the process and reassembles the original character.

Data source & conversion logic

  1. Read the text. Take whatever you typed or pasted, as a single value.
  2. Keep unreserved characters. Leave letters, digits and a handful of safe symbols (hyphen, underscore, dot, tilde, plus the exclamation mark, apostrophe, parentheses and star) as they are.
  3. Percent-encode the rest. Replace every other character — including reserved URL characters and spaces — with a percent sign and its hexadecimal code.
  4. Encode non-ASCII as UTF-8. Convert characters beyond ASCII to UTF-8 bytes and encode each byte.

What it encodes

space → %20 slash → %2F question mark → %3F equals → %3D ampersand → %26 accented é → %C3%A9 (UTF-8 bytes)
Worked example
a/b?c=d → a%2Fb%3Fc%3Dd

Letters, digits and the symbols hyphen, underscore, dot, tilde, exclamation mark, apostrophe, parentheses and star are left as-is; everything else is percent-encoded. This encodes a single value, not a whole URL.

Privacy

Your text is encoded in your browser with a built-in JavaScript function. Nothing is sent to a server, so you can safely encode values that contain private data.

Remember that percent-encoding is not encryption — it is fully reversible by anyone. Encode for safe transport, not for secrecy.

Technical Details

MethodencodeURIComponent (browser built-in)
Encodesreserved characters, spaces, non-ASCII
Leaves aloneletters, digits, hyphen, underscore, dot, tilde, and ! ' ( ) *
Space becomes%20 (not a plus sign)
Non-ASCIIUTF-8 bytes, each percent-encoded
Scopeone value or component, not a whole URL
Where it runsIn your browser — nothing uploaded

Standards & references

  • Percent-encoding (RFC 3986) — the URL standard defines unreserved characters (letters, digits, hyphen, underscore, dot, tilde) that need no encoding, and reserved characters that must be encoded when used as data rather than as delimiters.
  • encodeURIComponent — the JavaScript function this tool uses; it encodes the reserved characters (slash, question mark, ampersand, equals and the rest), unlike encodeURI, which leaves them for whole-URL use.
  • UTF-8 for non-ASCII — characters beyond ASCII are encoded as their UTF-8 bytes, so one accented or non-Latin character can become several percent-codes.

Accuracy & Limitations

It encodes a single component, not a whole URL. Run a complete address like the home page of a site through it and the slashes and colon become %2F and %3A, breaking the URL. Encode individual values (a search term, a parameter) and assemble the URL around them.

A space becomes %20, not a plus sign. Some systems (HTML form submissions) use a plus for a space in the query string; if you need that form, replace %20 with a plus yourself after encoding.

encodeURIComponent does not encode a few sub-delimiters — the exclamation mark, apostrophe, parentheses and star are left as-is even though RFC 3986 lists them as reserved. For most uses this is fine; if a strict parser needs them encoded, handle those characters separately.

It is reversible and offers no security. Percent-encoding hides nothing — anyone can decode it. Never use it to protect passwords, tokens or other secrets.

Encoding the same text twice double-encodes it: a percent sign from the first pass becomes %25 on the second. Encode once, and decode the matching number of times.

Real-World Use Cases

Query parameters

Encode a search term or value before adding it to a URL.

API requests

Safely place user input into a path segment or query string.

Building links

Encode a redirect or campaign value carried inside another URL.

Debugging

See exactly how a value will look once encoded in a request.

When to use it — and when not to

Good for

  • Encoding a single query value or path segment
  • User input going into a URL
  • Spaces and special characters in parameters
  • Seeing the percent-encoded form of a value

Not the best choice for

  • Encoding a whole, finished URL
  • Producing the plus-for-space form directly
  • Hiding or securing data (it is reversible)
  • Strict RFC encoding of the ! ' ( ) * characters

Encoding a complete, well-formed URL? encodeURI (a whole-URL encoder) leaves the separators intact. Need the plus-for-space form? Swap %20 for a plus after encoding. Want the reverse? Use the URL decoder.

Frequently Asked Questions

What is URL encoding?
Also called percent-encoding, it replaces characters that have special meaning in a URL — or that are not allowed in one — with a percent sign and a hex code. A space becomes %20, for example, so the value travels safely inside the link.
Why did my slashes and colons get encoded?
This tool encodes a single value with encodeURIComponent, which escapes the reserved characters that separate URL parts. That is correct for a parameter, but means you should not run a whole URL through it — encode the individual values instead.
What is the difference from encodeURI?
encodeURI is for a whole, well-formed URL and leaves the separators (slash, colon, question mark, ampersand) alone. encodeURIComponent, used here, encodes those too, because it is meant for one component that will sit inside a URL.
Why is a space %20 and not a plus?
encodeURIComponent uses %20 for a space. The plus-for-space convention belongs to HTML form submissions (the form-urlencoded format). If you need a plus, replace %20 after encoding.
What happens to accented or non-English characters?
They are converted to UTF-8 bytes and each byte is percent-encoded, so an é becomes %C3%A9 and many emoji become four codes. Decoding reassembles the original character.
Is URL encoding the same as encryption?
No. It is fully reversible and hides nothing — anyone can decode it. Use it for safe transport of characters, never to protect secrets.
Which characters are left unencoded?
The unreserved set — letters, digits, hyphen, underscore, dot and tilde — plus a few sub-delimiters that encodeURIComponent skips: the exclamation mark, apostrophe, parentheses and star.
What if I encode something twice?
It double-encodes. The percent signs from the first pass become %25 on the second, so the result is wrong until you decode it the same number of times. Encode once.
Can I encode a whole URL with this?
You can, but the separators get encoded too, which breaks the URL. Encode each value separately and build the URL around them, or use a whole-URL encoder for a finished address.
Does it change letters or numbers?
No. Plain letters A to Z, digits, and the safe symbols are left exactly as they are. Only special and non-ASCII characters are encoded.
Is my text uploaded?
No. Encoding happens entirely in your browser with a built-in function; nothing is sent anywhere.
How is a percent sign in my input encoded?
A literal percent sign becomes %25. That is why double-encoding is a problem — a second pass encodes the percent signs the first pass created.

References

Uses the browser's encodeURIComponent, leaving the unreserved characters and a few sub-delimiters (the exclamation mark, apostrophe, parentheses and star) untouched and percent-encoding the rest; it is explicit that this encodes a single value (not a whole URL), that a space becomes %20 (not a plus), and that encoding is reversible, not encryption.

PopularHot

JSON Formatter

JSON Formatter for developers — instant, offline-style and privacy-safe.

DeveloperOpen Tool
Popular

JSON Validator

JSON Validator for developers — instant, offline-style and privacy-safe.

DeveloperOpen Tool
Popular

Base64 Encoder

Base64 Encoder for developers — instant, offline-style and privacy-safe.

DeveloperOpen Tool
Popular

Hash Generator

Fast, free Hash Generator that runs entirely client-side in your browser.

DeveloperOpen Tool
Popular

UUID Generator

Fast, free UUID Generator that runs entirely client-side in your browser.

DeveloperOpen Tool
Trending

CSS Minifier

Fast, free CSS Minifier that runs entirely client-side in your browser.

DeveloperOpen Tool

Ready to try the URL Encoder?

It is free, private and runs entirely in your browser — no sign-up, no uploads, no limits.