Developer & Web Tools

URL Encoder / Decoder

Encode or decode URLs, URI parameters, and query strings with support for standard and component modes.

Input Text / URL

Output Result

Overview

About the URL Encoder / Decoder

URLs can only be sent over the Internet using the standard ASCII character set. Unsafe characters (such as spaces, ampersands, question marks, and non-ASCII glyphs) must be transformed into valid percent-encoded representations (%20, %26).

Our URL Encoder/Decoder runs fully client-side to instantly encode raw text into web-safe URL strings, or reverse percent-encoded strings back into readable text.

Mathematical Method

How the Calculations Work

Unsafe characters are replaced with a "%" followed by two hexadecimal digits representing their UTF-8 byte value.

encodeURIComponent(str) / decodeURIComponent(str)

Variables & Definitions

  • Input: Raw string or percent-encoded query
  • Output: Standardized RFC 3986 encoded or decoded string
Plain-English Worked Example

https://example.com?query=hello world&lang=en encodes space as %20.

Terminology

Key Terms Explained

Percent-Encoding

A mechanism for encoding characters in a Uniform Resource Identifier (URI) using a "%" prefix.

encodeURIComponent

Encodes all special characters including & , / : ; = ? @ to allow safe inclusion in query strings.

Best Practices

Practical Tips & Pitfalls to Avoid

1

Encode individual query values, not the whole URL structure

Using encodeURIComponent on a full URL will escape the colon and slashes in https://.

Q&A

Frequently Asked Questions

Web servers use reserved characters like ? and & to identify query parameters. Encoding prevents parameters from conflicting with protocol delimiters.

Calculator Directory
Categories 60 Tools