# URL Encode/Decode

> Encode and decode URL components, query parameters, and special characters for safe use in web addresses.

- Open the tool: https://overtooled.com/url-encode
- Category: Developer
- Privacy: Runs entirely in your browser. Nothing is uploaded, no account is needed, and it works offline once loaded.
- Price: free, no sign-up
- Keywords: url, encode, decode, percent, query, uri

## In short

Encode and decode URLs, query parameters, and special characters.

## Overview

Percent-encodes or decodes text using JavaScript's encodeURIComponent and decodeURIComponent, live as you type. Meant for encoding query parameter values, path segments, and other URL components, or for reading an encoded string.

## Features

- Encode and Decode modes via a toggle; switching mode moves the result into the input
- Live conversion on every keystroke
- Non-ASCII text is encoded as UTF-8 %XX byte sequences
- Shows "Invalid URL-encoded input" when decoding fails (for example a stray % not followed by two hex digits)
- Copy and Pipeline buttons on the output; Clear button on the input

## How to use it

1. Choose Encode or Decode
2. Type or paste text into the left box
3. Copy the result from the right box

## Inputs

- Encode: any text (a single value or a whole URL)
- Decode: percent-encoded text

## Outputs

- Percent-encoded text or decoded plain text
- Copy to clipboard; send to another tool via Pipeline

## Limits and notes

- Encoding is always component-style (encodeURIComponent): the whole input is encoded, including :, /, ?, &, and =, so encoding a full URL makes it unusable as a URL; there is no encodeURI / full-URL mode
- Characters left unencoded: A-Z a-z 0-9 - _ . ! ~ * ' ( )
- Spaces encode as %20, not +; on decode, + is left as a literal + (no form-encoding mode)
- Text containing unpaired surrogate characters fails to encode
- Nothing is saved to localStorage; runs entirely in the browser with no upload

## Questions and answers

### How does the URL Encoder work?

Encoding uses JavaScript's encodeURIComponent(), which converts every character except A-Z, a-z, 0-9, and - _ . ! ~ * ' ( ) into its UTF-8 bytes written as %XX. Decoding uses decodeURIComponent() to reverse this. Because it is component-style encoding, characters like /, :, ?, and & are encoded too; there is no separate full-URL (encodeURI) mode.

### What is URL encoding?

URL encoding replaces unsafe characters with percent-encoded equivalents (e.g., space becomes %20, & becomes %26). This ensures special characters in URLs are transmitted correctly by browsers and servers.

### When do I need to URL encode?

Whenever you include user input, special characters, or non-ASCII text in URLs, query parameters, or form data. Common cases include building API URLs, generating links with parameters, and encoding file names.

### What is the difference between encodeURI and encodeURIComponent?

encodeURI is meant for a full URL and leaves structural characters such as :, /, ?, &, =, and # intact. encodeURIComponent is meant for a single value and also encodes those characters, leaving only letters, digits, and - _ . ! ~ * ' ( ) unencoded. This tool uses encodeURIComponent, so it is best for query parameter values and path segments.

## Related tools

- [Base64 Encode/Decode](https://overtooled.com/base64.md): Encode text to Base64 or decode Base64 strings instantly
- [HTML Entity Encoder/Decoder](https://overtooled.com/html-entities.md): Encode special characters to HTML entities and decode them back
- [JWT Decoder](https://overtooled.com/jwt-decoder.md): Decode and inspect JWT token headers, payloads, and claims
- [QR Code Generator](https://overtooled.com/qr-code.md): Generate single or bulk QR codes from text, URLs, or CSV. Download as PNG or ZIP.

---
Overtooled: 179 free tools that run in your browser. Index of all tools: https://overtooled.com/llms.txt
