URL Component Encode / Decode Tool

Encode or decode URL components and query values.

Save

Calculator

Inputs

URL component or text to process.

Choose whether to encode or decode the text.

Live output

Results

Encoded / Decoded Text
hello%20world%20%26%20more

Report

Export and share

Document

Copy and share

Assumptions

  • Encoding uses JavaScript's `encodeURIComponent`, which is best suited for URL parts and query values rather than preserving a whole URL structure.
  • Decoding expects valid percent-encoded text and will show an error for malformed sequences.
  • The tool treats the input as plain text and does not validate whether the final result is a working URL.

Sensitivity preview

No numeric sensitivity scenarios are available.

Related Tools

View All

About this URL Encoder

URL components such as query values, path segments, and redirect parameters often need percent-encoding before they can be safely transported. This tool is built for those parts rather than for preserving a full URL unchanged.

Who this calculator is for

  • Frontend and backend developers working with query strings, redirect targets, and webhook payloads.
  • Marketers and SEO teams building UTM-tagged links without breaking special characters.
  • Anyone troubleshooting copied URLs that fail because spaces, symbols, or unicode text were not encoded.

When to use it

  • Encode a query parameter value before appending it to a search, tracking, or API URL.
  • Decode a percent-encoded URL fragment to inspect what a browser or app actually sent.
  • Prepare path segments or redirect targets that contain spaces, punctuation, or non-English characters.

How to use this calculator

  1. Paste the URL component or text value you want to convert.
  2. Select Encode to turn reserved characters into `%` codes.
  3. Select Decode to turn % codes back into symbols.

Key assumptions

  • Encoding uses JavaScript's `encodeURIComponent`, which is best suited for URL parts and query values rather than preserving a whole URL structure.
  • Decoding expects valid percent-encoded text and will show an error for malformed sequences.
  • The tool treats the input as plain text and does not validate whether the final result is a working URL.

Accuracy and testing

Review formula sources, default test cases, assumptions, unit handling, rounding rules, and changelog for this calculator.

View accuracy page

How this calculator works

Uses the `encodeURIComponent` JavaScript function. It replaces unsafe characters with a `%` followed by two hexadecimal digits. For example, a space (ASCII 32) becomes `%20`.

Key Features

  • Percent Encoding Logic
  • Handles special chars
  • Secure client-side processing

Glossary of Terms

Percent-Encoding
A mechanism for encoding information in a Uniform Resource Identifier (URI).
Query String
The part of a URL following the ? symbol, often containing data that needs encoding.

Frequently Asked Questions

Why do URLs need to be encoded?
URLs can only be sent over the Internet using the ASCII character-set. Characters outside this set (like spaces or emojis) must be converted into a valid ASCII format (percent encoding).
What does %20 mean?
%20 is the percent-encoded value for a standard Space character.
What is the difference between encodeURI and encodeURIComponent?
encodeURI is used for full URLs (it preserves characters like :, /, ?). encodeURIComponent is used for query string parameters (it encodes everything, including slashes and colons).
Which characters are considered 'unsafe' in URLs?
Unsafe characters include spaces, quotes, < > # % { } | \ ^ ~ [ ] `. These often have special meanings or can be misinterpreted by gateways.
Does encoding affect SEO?
Search engines can generally read encoded URLs, but clean, readable URLs are preferred for user experience. Avoid excessive parameters that require heavy encoding.