Skip to main content
True Calculator

URL Encode / Decode Calculator

Encode or decode text to UTF-8 percent-encoding — with byte sizes, changed characters and a per-character breakdown.

Direction

Enter text to encode or decode. Encoding follows the UTF-8 percent-encoding rules used by encodeURIComponent.

Last updated: June 2026

How this calculator is verified

Checked by True Calculator automated test suite on

  • Formula verified against a published worked example in the automated test suite
  • Edge cases (zero, negative, boundary and unit-mismatch inputs) covered by unit tests

The full verification method is on our how we verify page. Found an error? Tell us and we will re-check it.

When to Use This Calculator

Whenever you copy a link with spaces, emojis or Indian-language characters, it often breaks because browsers expect percent-encoded URLs. This tool encodes or decodes any string instantly, which is useful when you are preparing API test calls, building query parameters with values that contain special characters, or decoding a long marketing link that looks like a jumble of %20 and %2F symbols. Developers testing webhooks or form submissions use it constantly to see exactly what a server will receive. Paste the raw string or the encoded URL, choose encode or decode, and copy the result straight back into your request. SEO professionals also percent-encode URLs before submitting them to tools like Search Console, where unencoded characters trigger errors. The tool also comes in handy when sharing links on WhatsApp or email, where long unencoded URLs with query parameters are frequently mangled into broken links. Developers also use it before storing URLs in databases, since percent-encoded values survive round-trips cleanly. Browser extensions and developer tools use the same percent-encoding rules, so the output here matches what a server will decode.

How to Use This Calculator

  1. Step 1: Paste the text or partial URL you want to fix into the input box.
  2. Step 2: Choose encode to turn special characters into percent-encoded form.
  3. Step 3: Copy the encoded result into your link, form action or API call.
  4. Step 4: Use decode on any received query string to see the original text behind the percent codes.

Worked Example

You are building a search link and the parameter value is hello world with a space. Paste q=hello world into the tool and encode; the space becomes %20, giving q=hello%20world, which browsers and APIs accept. Reserved characters such as & and = are encoded too, so your parameter values survive inside a query string. The decoder reverses the process: a link showing %E0%A4%A8 for the first character of the Hindi word namaste decodes back to the readable text. Use the tool whenever a link with spaces or special characters breaks.

Tips and Common Mistakes

  • •Tip 1: Percent-encoding applies per character — a space is %20, a newline becomes %0A, and the decoder restores each one exactly.
  • •Tip 2: Encode only the parameter values, not the whole URL with its protocol, so the link structure stays intact.
  • •Tip 3: URLs that look clean in a browser may still hide encoded characters — decode before comparing two links by eye.
  • ✗Mistake 1: Encoding an already-encoded string, which turns %20 into %2520 and quietly corrupts the value.
  • ✗Mistake 2: Leaving raw spaces or non-ASCII characters in query strings — most servers reject or misparse them before your code runs.

Frequently Asked Questions

What is URL encoding and when do I need it?

URL encoding (percent-encoding) replaces unsafe characters with a % sign followed by two hex digits so they can travel safely in a URL. Spaces become %20, and non-ASCII characters like Hindi letters are encoded in UTF-8 — for example the first character of 'namaste' in Devanagari becomes %E0%A4%A8.

Why do my Hindi or regional-language links break when I share them?

Raw non-ASCII characters like Devanagari, Tamil or Bengali text in a query string are rejected or misparsed by many servers. Encoding the text with this tool turns it into a safe string that works in browsers, WhatsApp and APIs.

Should I encode the whole URL or just the parameter values?

Encode only the parameter values and path segments, not the scheme and host. Encoding https://example.com itself can corrupt the link — keep the protocol and domain plain and encode what comes after them.

Why does my encoded text show %2520 instead of %20?

That is double encoding — the encoder was run on a string that was already encoded, so the % of %20 became %25. Use the decode tool once to restore the original value, then encode only the raw text.

What is the difference between URL encoding and base64?

URL encoding percent-encodes characters for use in web addresses, while base64 turns any binary data into a shorter printable string for APIs, tokens and image data URIs. This calculator handles percent-encoding; the base64 calculator on this site handles the other.

You might also need

Related calculators from other categories