NordVPN
SponsoredStrict no-logs VPN with 6,400+ servers in 111 countries. Threat Protection blocks ads, trackers, and malware while you work online.
Get NordVPN →Use to embed text safely in URLs, query parameters, or form data. Handles spaces, special characters, and Unicode (including CJK and emoji) correctly.
URLs are restricted to a small set of ASCII characters. To include anything else — spaces, accents, Chinese characters, emoji, special symbols — you replace each unsafe byte with %XX where XX is its hexadecimal byte value. A space becomes %20, a slash %2F, the kanji 漢 becomes %E6%BC%A2 (its UTF-8 bytes percent-encoded).
This calculator uses the browser's built-in encodeURIComponent and decodeURIComponent. It encodes everything that isn't an unreserved character (letters, digits, -._~), which is the right behavior for query parameters and form data.
JavaScript has two encoders. encodeURI leaves URL structure characters (/ ? & # = + etc.) alone — use it on a full URL. encodeURIComponent escapes all of those — use it on the value inside a query parameter.
This tool uses encodeURIComponent, the safer choice for embedding arbitrary text into a URL. If you have a full URL with structure you want to preserve, encode only the parts that need it.
Plus sign in URLs. Some servers treat '+' as a space (a legacy from form encoding). encodeURIComponent leaves '+' alone, but a server might decode it to space. To be safe, replace '+' with %2B if you're sending it as data.
Double encoding. Encoding an already-encoded string adds another layer (% becomes %25, so '%20' becomes '%2520'). Always check whether the input is already encoded before running encode again.
Length increase. UTF-8 multi-byte characters expand to 3-4 percent-codes each. A 100-character Japanese string easily becomes a 900+ character URL.
It should — but if you have '+' in a URL it might also represent space (legacy form encoding). Replace + with space first if needed.
Yes. Emoji are encoded as their UTF-8 byte sequences (typically 4 bytes / 4 percent-codes per emoji).
URL encoding uses % notation for URL contexts. HTML encoding uses < > etc. for HTML. Different contexts, different rules.
Encode any value going into a URL query parameter, path segment containing user input, or form data. Don't encode an already-built URL — that double-encodes.
A bare '%' followed by something that isn't valid hex is invalid percent-encoding. Encode '%' to '%25' before including it in a URL.
Yes — when building URLs via URL or URLSearchParams APIs. This tool exposes the same logic for ad-hoc use.
Letters (A-Z, a-z), digits (0-9), and these: - . _ ~ . Everything else gets percent-encoded by encodeURIComponent.
No. Encoding and decoding both run locally.
Strict no-logs VPN with 6,400+ servers in 111 countries. Threat Protection blocks ads, trackers, and malware while you work online.
Get NordVPN →Managed cloud hosting for WordPress and web apps on DigitalOcean, Vultr, and AWS. Fast setup, no server headaches.
Try Cloudways →Hire freelancers for design, writing, dev, and marketing — or sell your own services. Millions of gigs at every budget.
Browse Fiverr →