link

URL Encoder / Decoder

Percent-encode text for safe URL use, or decode URL-encoded strings

edit_calendar Last updated: Jul 22, 2026 | verified Reviewed by Calkulator Team | timer 2 min read
Developer illustration
Developer

Encode or decode URLs with special characters safely

Spaces become %20, ampersands become %26, and other special characters get percent-encoded for safe URL transmission. Essential when building query strings, API requests, or debugging broken links.

tips_and_updates Use encodeURIComponent() in JavaScript for query parameter values — encodeURI() does not encode &, =, ?, or #.
Text / URL to Encode
Encoded Output
Common Percent-Encoded Characters
Space → %20
! → %21
# → %23
& → %26
= → %3D
? → %3F
@ → %40
+ → %2B
insights
Live Result Illustration
Visual summary — updates instantly as you enter values above
LIVE
Tool Output Updates in real-time // Input Hello, World! ───────────────── Encoding: UTF-8 Length: 13 bytes // Output SGVsbG8sIFdvcmxkIQ== ───────────────────── Format: Base64 Length: 20 chars Do not paste sensitive credentials, tokens, or private keys into any online tool — use local tools for security-critical work.
tips_and_updates

Real-Life Guide to Using the URL Encode/Decode

Percent-encode URL components. Use the examples and checks below to turn the number into a practical decision.

When this calculator is useful

Use this when building a query string with special characters, sharing a link that contains spaces or non-English text, or debugging why a URL parameter is being cut off or misread by a server.

For most people, the best way to use the URL Encode/Decode is to try the real case first, then change one input at a time. That makes the trade-off visible. For example, with a loan calculator you can change tenure while keeping the same rate; with an investment calculator you can change return assumption while keeping the same monthly contribution; with a health, education or measurement calculator you can check how much one input changes the final category.

The result should answer a practical question: Can I afford this? How much should I save? Is this score enough? Is this measurement within range? What is the safer or cheaper option? If the output does not answer the decision clearly, adjust the inputs until the scenario matches your real situation.

lightbulb Real-Life Example
Building a search query with special characters: A developer is constructing a URL to search for "50% off & free shipping" on an e-commerce site's search endpoint.
1Encoding the phrase produces 50%25%20off%20%26%20free%20shipping, which can be safely appended as ?q=50%25%20off%20%26%20free%20shipping without the % or & characters breaking the query string structure.
2Now change one input, such as rate, time, quantity, unit or score, and compare the new result with the first one.
Characters that have special meaning in URLs, like %, &, and spaces, must be percent-encoded whenever they appear inside a parameter value rather than in their structural role.

Practical Advice

Use the URL Encode/Decode as a planning tool, not just a number generator. Write down the inputs you used, because the final answer is meaningful only when you remember the assumptions behind it.

If the decision affects money, health, tax, safety, academics or legal compliance, keep a second check ready. That second check may be a bank quote, payslip, official rule, prescription, site measurement, mark sheet or invoice.

Common Mistakes

  • Encoding an entire URL including the protocol and domain (e.g. turning https:// into https%3A%2F%2F), which breaks the link — only individual parameter values should typically be percent-encoded.
  • Forgetting that a space in a query string should become %20 (or + in form-encoded data), not left as a literal space, which many servers will truncate the URL at.
  • Double-encoding a string that is already percent-encoded, turning %20 into %2520, which then displays as a literal "%20" instead of a space when decoded once.
  • Not encoding reserved characters like &, =, or # inside a parameter value, which get misinterpreted as separating a new parameter or a URL fragment instead of being part of the data.
  • Assuming URL encoding and Base64 encoding are interchangeable — they solve different problems and produce different, non-compatible output for the same input.

How to Interpret Results

Encoding replaces unsafe or reserved characters with % followed by their hex byte value so the string can travel safely inside a URL; decoding reverses %XX sequences back to the original characters — check that decoded output matches your original text exactly, especially around spaces and symbols.

A good interpretation looks at both the main result and the supporting values. If a page shows totals, ratios, categories, schedules or warnings, read those together instead of focusing only on the biggest number.

quiz

URL Encode/Decode FAQs

Useful answers for interpreting the output, avoiding mistakes and using the result responsibly.

What does URL encoding actually do?
It converts characters that are unsafe or reserved in a URL — like spaces, &, =, #, and non-ASCII characters — into a % followed by their hexadecimal byte value, so the URL remains a valid, unambiguous address that browsers and servers can parse correctly.
What is the difference between encodeURIComponent and encodeURI (or full URL encoding vs. component encoding)?
Full URL encoding leaves structural characters like :, /, and ? untouched since they define the URL's parts, while component encoding (used for individual query parameter values) also escapes those characters because within a single value they would otherwise be misread as structure. This tool encodes at the component level, suitable for values you are inserting into a query string.
Why does my link break when I paste a URL containing non-English characters?
Browsers display many Unicode characters directly, but the underlying HTTP request must transmit them as UTF-8 bytes percent-encoded — a Hindi or Chinese character in a URL bar is actually sent as multiple %XX sequences, and copying it as plain text into some systems can corrupt or truncate it.
What happens if I encode a string that is already encoded?
You get double-encoding — for example, a space already converted to %20 becomes %2520 when encoded again, since the % itself gets encoded to %25. Decoding it once will then show the literal text "%20" instead of a space, which is a common source of confusing bugs in redirect chains.
Should I use %20 or + for spaces in a URL?
%20 is the standard percent-encoding for a space and works everywhere in a URL. The + character is a special case used specifically in application/x-www-form-urlencoded data (like traditional HTML form submissions) to represent a space, but using + inside a general query value can be misread literally by some parsers.
Why do I need to encode & and = inside a parameter value?
Those characters normally separate key-value pairs in a query string (like ?a=1&b=2), so if your actual data value contains a literal & or =, it must be percent-encoded to %26 or %3D or the server will incorrectly parse it as the start of a new parameter.
Can URL encoding be used to hide sensitive data in a link?
No — percent-encoding is fully reversible with no key, so anyone can decode it instantly, and encoded URLs are also commonly logged in plain form by browsers, proxies, and servers. Never rely on URL encoding for confidentiality of tokens, passwords, or personal data.
How do I debug a URL parameter that seems to be getting cut off?
Decode the full query string first to see what characters are actually present, check for an unencoded &, #, or space that may be splitting the URL early, and re-encode only the parameter value (not the whole URL) before rebuilding the link.

What is URL Encoding?

URLs can only contain certain ASCII characters. Special characters (spaces, punctuation, non-ASCII) must be percent-encoded — replaced with % followed by two hex digits representing the character's UTF-8 byte value. For example, a space becomes %20, and © becomes %C2%A9.

This tool uses JavaScript's encodeURIComponent(), which encodes everything except letters, digits, and -_.!~*'(). Use this when encoding a query parameter value. If you need to encode a full URL (preserving /, ?, #), use encodeURI() instead.

lightbulb Example
Encode "hello world & more?":
1Space → %20, & → %26
2? → %3F
hello%20world%20%26%20more%3F

quizFrequently Asked Questions

What is URL encoding and why is it needed?
URLs can only safely contain certain ASCII characters. Special characters like spaces, &, =, #, and non-ASCII characters (like Devanagari script) must be percent-encoded: each byte is replaced by a % followed by its hexadecimal value. A space becomes %20, & becomes %26. Without encoding, these characters would be misinterpreted as URL structure.
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent encodes everything except letters, digits, and - _ ! ~ * ' ( ). Use it to encode a single query parameter value. encodeURI leaves URL structure characters (: / — # & =) unencoded — use it when encoding a full URL while preserving its structure. In practice: always use encodeURIComponent for query parameter values in your code.
Which characters are safe in a URL without encoding?
Unreserved characters are always safe: A–Z, a–z, 0–9, hyphen (-), underscore (_), period (.), and tilde (~). All other characters — including spaces, Unicode, and reserved characters when used as data rather than URL structure — should be percent-encoded. RFC 3986 defines the complete URL syntax and encoding requirements.
keyboard_arrow_up