Encode/decode URL-formatted strings

Encode ↔ decode URL-formatted strings

Percent-encode and decode strings locally in your browser with instant copy

Last updated: January 28, 2026
Frank Zhao - Creator
CreatorFrank Zhao

Encode

Decode

Introduction / overview

Encode/decode URL-formatted strings helps you convert text to and from URL percent-encoding. It is especially useful when you are working with query strings, path segments, or copy-pasting values between tools.

If a URL looks “broken” because it contains a lot of %\% sequences, decoding it is usually the first step. If a value contains spaces, ampersands, or non-ASCII characters, encoding it is usually the safer step.

Who typically uses this?

  • Developers debugging query parameters and API calls.
  • SEO / marketing teams preparing tracking links with UTM parameters.
  • Anyone copying values between spreadsheets, emails, and URLs.

For related tools, you might like Base64 String Encoder/Decoder (for safe transport of arbitrary bytes), Hash Text (for checksums), or Token Generator (for random secrets).

How to use / quick start

1

Encode a value

Paste the plain string into the Encode input. The tool uses encodeURIComponent\texttt{encodeURIComponent} semantics.

2

Copy the encoded output

Use the Copy button to paste it into a URL, API request, or query parameter.

3

Decode an encoded value

Paste the percent-encoded string into the Decode input. If it contains malformed sequences, the tool will show an error.

Worked example (encode)

Input: Hello world :)\text{Hello world :\,)}

Hello world :)\text{Hello world :\,)}
\downarrow
Hello%20world%20%3A)

Notice how a space becomes %20\%20 and the colon becomes %3A\%3A.

Worked example (decode)

Input: Hello%20world%20%3A)\text{Hello\%20world\%20\%3A)}

Hello%20world%20%3A)
\downarrow
Hello world :)\text{Hello world :\,)}

If the input contains an invalid escape like %ZZ\text{\%ZZ}, decoding will fail.

Real-world examples / use cases

Building a query parameter safely

Suppose you want to send a search term: red shoes & socks\text{red shoes \& socks}.

red shoes & socks\text{red\ shoes\ \&\ socks}
\downarrow
red%20shoes%20%26%20socks

You can now append it as q=...\texttt{q=...} without the ampersand splitting your parameters.

Reading a copied tracking link

A campaign name might look like: Spring%202026%20Launch\text{Spring\%202026\%20Launch}.

Spring%202026%20Launch
\downarrow
Spring 2026 Launch\text{Spring\ 2026\ Launch}

Decoding makes it readable before you paste it into reports.

Fixing a malformed percent sequence

If you see an input like %ZZ\text{\%ZZ}, decoding fails. Replace it or re-copy the URL.

In other words, percent escapes must follow %[0-9A-F]{2}\%[0\text{-}9A\text{-}F]{\{2\}}.

Preparing values for copy/paste tools

When moving data between tools, encoding helps you keep special characters intact. If your data is binary-like or long, consider Base64 String Encoder/Decoder instead.

Common scenarios / when to use

Spaces and punctuation in parameters

Encode values before adding them after a question mark in a URL.

Copying text from logs

Decode to make it readable and to spot the real value quickly.

Debugging API requests

Verify that your client is encoding exactly what you intend.

Avoiding accidental parameter splitting

Encode &\& and == inside values.

Cleaning up a shared link

Decode chunks to see what the link actually contains.

When it may not be the right tool

If you need full URL parsing, you likely want a dedicated URL parser.

Tips & best practices

Pro tip: Encode values, not the entire URL. If you encode https://\texttt{https://} you will end up with a URL that is no longer clickable.

Quick checks that prevent mistakes

  • If decoding fails, look for an incomplete escape like %2\text{\%2} or non-hex like %G1\text{\%G1}.
  • If your input came from an HTML form, remember that ++ sometimes represents a space. This tool follows decodeURIComponent\texttt{decodeURIComponent} (not form decoding).
  • If you need to protect a payload, encode is not encryption. Pair with Encrypt/Decrypt Text if you need confidentiality.

Calculation method / formula explanation

Percent-encoding represents bytes using a percent sign and two hexadecimal digits. Conceptually, a byte bb becomes %HH\%HH where HH are hex digits.

b[0,255]  escape(b)=%hex(b)b \in [0,255]\ \Rightarrow\ \text{escape}(b)=\%\mathrm{hex}(b)

(shown as a conceptual rule; actual encoding applies to UTF-8 bytes)

In practice, the browser APIs treat your input as a Unicode string, convert it to UTF-8, then escape reserved bytes. This tool strictly follows the behavior of encodeURIComponent\texttt{encodeURIComponent} and decodeURIComponent\texttt{decodeURIComponent}.

Related concepts / background info

URI vs URL vs component encoding

Many apps only need to encode a single value (a “component”), not an entire URL. That is why this tool mirrors encodeURIComponent\texttt{encodeURIComponent}.

Why does ++ sometimes mean space?

That convention comes from HTML form encoding. It is not the same as decoding a percent-encoded URI component.

If you are transforming text rather than URLs, you may also like Case Converter.

Frequently asked questions (FAQs)

What does “URL-formatted” mean here?

It refers to percent-encoded sequences like %20\%20 and %3A\%3A.

Is this the same as encoding the entire URL?

No. This tool behaves like encodeURIComponent\texttt{encodeURIComponent} and is intended for encoding a value.

Why does decoding sometimes fail?

Because the input contains malformed escapes. A valid escape looks like %[0-9A-F]{2}\%[0\text{-}9A\text{-}F]{\{2\}}.

Does encoding protect sensitive data?

No. Encoding is reversible. Treat it like formatting, not security.

When should I use Base64 instead?

If you need to transport arbitrary bytes or large payloads in a compact form, use Base64 String Encoder/Decoder.

Limitations: this tool does not validate full URLs, does not parse query strings into key/value tables, and does not perform form decoding. It only encodes/decodes a string component.

Limitations / disclaimers

This tool is intended for text formatting and debugging. It does not guarantee that a resulting full URL is valid or safe. Always validate and test your final links in your target environment.

Encode/decode URL-formatted strings | CalculatorVast