πŸ”— URL Encoder / Decoder

Encode or decode any URL string β€” handles special characters, query strings, percent-encoding

Common URL Encoding Reference

CharacterEncodedCharacterEncoded
Space%20&%26
!%21=%3D
#%23+%2B
$%24?%3F
%%25@%40
/%2F:%3A

What is URL Encoding?

URL encoding (also called percent-encoding) is a method of converting characters that are not allowed or have special meaning in URLs into a safe format. URLs can only contain a limited set of characters β€” letters, digits, and a few special characters like hyphens, underscores, periods, and tildes. Any other character must be encoded as a percent sign (%) followed by its two-digit hexadecimal value.

For example, a space character cannot appear in a URL, so it becomes %20. A question mark (?) has special meaning as a query string separator, so if you want a literal question mark in a value, it must be encoded as %3F. Calculator Expert's URL Encoder/Decoder handles all of these conversions instantly.

How URL Encoding Works

Encoding: Each unsafe character β†’ %XX (XX = hexadecimal ASCII/UTF-8 code)
Space (ASCII 32) β†’ %20
@ (ASCII 64 = 0x40) β†’ %40
Decoding: %XX sequences β†’ original characters
Safe characters (not encoded): A-Z a-z 0-9 - _ . ~ ! * ' ( )

URL Structure and Where Encoding Applies

A URL has several parts: scheme (https://), host (www.example.com), path (/page/name), query string (?key=value&key2=value2), and fragment (#section). Encoding is most commonly needed in query string values, where user-submitted data (which may contain spaces, special characters, or non-Latin text) must be safely transmitted. Path segments also need encoding if they contain reserved characters.

Who Needs URL Encoding?

Web developers building APIs and query strings with user data. Backend engineers handling form submissions with special characters. SEO professionals analyzing and cleaning URLs. Security researchers testing web application inputs. Developers building OAuth authentication URLs that contain encoded redirect URIs. Content managers creating shareable links with search terms that include spaces or special characters. Mobile app developers constructing API endpoint URLs programmatically.

Encoding vs Decoding

Use ENCODE when you need to convert human-readable text or a URL with special characters into a safe, transmittable URL format. Use DECODE when you receive a percent-encoded URL (e.g., from a browser address bar or API response) and want to read it in its original human-readable form. Most programming languages provide built-in functions: encodeURIComponent() in JavaScript, urllib.parse.quote() in Python, Uri.EscapeDataString() in C#.

encodeURI vs encodeURIComponent

JavaScript has two encoding functions with different behaviors. encodeURI() encodes a complete URL and does NOT encode characters that are valid parts of a URL structure (like /, ?, =, &). encodeURIComponent() encodes everything including these characters β€” it is used for encoding individual query parameter values. This tool uses encodeURIComponent for encoding and decodeURIComponent for decoding, which is the safer and more thorough choice for general use.

How to Use This Tool

Paste your URL, query string, or any text into the input area. Click "Encode URL" to convert special characters to percent-encoded format, or "Decode URL" to reverse the encoding back to readable text. The result appears in the output box. Click Copy to copy it to your clipboard. The reference table below the buttons shows common character encodings for quick reference.

⚠️ Limitations

This tool uses encodeURIComponent/decodeURIComponent, which handles most standard cases but does not distinguish between encoding a full URL vs. a query parameter value. For full-URL encoding that preserves /, ?, and &, use a specialized tool. Malformed percent sequences (e.g., %XY where XY is not valid hex) may cause a decoding error. Non-UTF-8 encoded URLs from very old systems may not decode correctly.