Encode · Developer

URL Encoder / Decoder

Encode or decode URI components for query strings and path segments.

What is URL Encoder / Decoder?

The URL Encoder / Decoder percent-encodes and decodes text so it can be placed safely in a URL. Percent-encoding, defined in RFC 3986, replaces characters that are reserved or unsafe in URLs with a % followed by their byte value in hexadecimal — for example, a space becomes %20.

By default the tool encodes components (like a single query value or path segment) using encodeURIComponent, which escapes reserved characters such as & = ? / and #. Decoding uses decodeURIComponent and also converts + to a space, matching how form submissions encode spaces.

It runs entirely in your browser.

Why Use This Tool?

Placing raw text into a URL breaks it when the text contains reserved characters. Encoding query values and path segments keeps links valid and prevents parameters from being misparsed or truncated.

  • Safely embed values in query strings and paths.
  • Decode parameters you receive to read their real content.
  • Handle spaces, ampersands, and Unicode correctly.
  • Avoid broken or ambiguous URLs.

How Does This Tool Work?

In component mode, encoding calls encodeURIComponent, which escapes every character except the URI-unreserved set, so reserved delimiters inside a value are preserved as data rather than interpreted as structure. A whole-URL mode uses encodeURI, which leaves reserved delimiters like :/?#& intact so the overall URL still functions.

Decoding first replaces + with a space (the application/x-www-form-urlencoded convention) and then applies decodeURIComponent to turn percent-escapes back into their original characters.

Understanding Your Results

Encoded output contains %XX sequences for each escaped byte; UTF-8 characters expand into multiple percent-escapes. Decoded output restores the original text. If decoding throws, the input contains a malformed percent-escape (for example a lone % not followed by two hex digits).

Choosing the wrong mode is the usual pitfall: encode individual values with component mode, and reserve whole-URL mode for an entire address you do not want to break apart.

Why Tracking This Matters

Query strings drive search, filters, tracking, and API calls. Correct encoding keeps user input, tokens, and special characters intact end-to-end, avoiding subtle bugs where an unescaped & silently splits one parameter into two.

Benefits of Using URL Encoder / Decoder

  • Component and whole-URL modes
  • Correct UTF-8 percent-encoding
  • Handles the + as space convention on decode
  • Prevents broken or ambiguous URLs
  • Reversible, lossless conversion
  • Runs privately in your browser

How Is the Result Calculated?

Percent-encoding maps each byte that must be escaped to a three-character sequence: % plus two uppercase hex digits. Multi-byte UTF-8 characters produce one escape per byte, so a single emoji may expand into four %XX sequences.

escaped byte → %XX (two hex digits)

Tips for Better Results

  • Encode values, not the whole URL, unless you specifically want whole-URL mode.
  • Remember + decodes to a space in form-encoded query strings.
  • Encode each query parameter separately, then join with & and =.
  • Watch for double-encoding — encoding an already-encoded value escapes the % signs.
  • Use the URL Parser to inspect a full URL's components.

Standards and References

Conclusion

The URL Encoder / Decoder applies RFC 3986 percent-encoding so values travel safely inside URLs, with sensible handling of the + as space convention on decode.

Encode individual components by default, reserve whole-URL mode for complete addresses, and avoid double-encoding.

Privacy & how it works

This developer utility runs in your browser with JavaScript and Web APIs. Your text, tokens, and secrets are not uploaded to The ToolSphere servers for this tool. Privacy Policy.

FAQ

Does this encode a full URL or a single value?expand_more

By default it encodes components (encodeURIComponent), which is right for individual query values or path segments. Whole-URL mode (encodeURI) leaves structural delimiters like :/?# intact.

Why does encodeURIComponent escape & and =?expand_more

Because inside a single value those characters would otherwise be read as parameter separators. Escaping them keeps them as literal data.

Why does + become a space when decoding?expand_more

Form submissions (application/x-www-form-urlencoded) encode spaces as +. The decoder converts + to a space before applying decodeURIComponent to match that convention.

What is percent-encoding?expand_more

It is the RFC 3986 mechanism of replacing reserved or unsafe characters with % followed by the character's byte value in hexadecimal, such as %20 for a space.

How are non-ASCII characters handled?expand_more

They are encoded as their UTF-8 bytes, so each character may become several %XX sequences. Decoding reassembles the original UTF-8 text.

Why did decoding fail?expand_more

The input has a malformed percent-escape — for example a % not followed by two valid hex digits. Fix or remove the stray % and try again.

What is double-encoding and how do I avoid it?expand_more

Double-encoding happens when you encode text that is already encoded, turning % into %25. Encode a value only once before putting it in a URL.

When should I use whole-URL mode?expand_more

Use it when you have a complete URL and only want to escape illegal characters without breaking the scheme, host, and path structure.

Does encoding change the data itself?expand_more

No. Encoding and decoding are lossless and reversible. You recover the exact original text when you decode with the matching mode.

Is my input uploaded?expand_more

No. Encoding and decoding run in your browser. Your text is not sent to The ToolSphere servers for this tool.

Is this tool free?expand_more

Yes. No signup and no paywall for core use.

Is my text uploaded?expand_more

No for this tool. Text stays in your browser while you work.

Suggest an improvement

Tell us what would make this tool more useful. We read every suggestion.

Feedback for: URL Encoder / Decoder