---
title: "URL encode"
description: "Percent-encode a string for URL query values and path segments. Local encodeURIComponent behaviour."
---

> HTML: https://trendalyzer.app/tools/url-encode/
> Index: https://trendalyzer.app/llms.txt

# URL encode

URL encode escapes characters outside the unreserved set so a value can travel safely in a query string or path segment. It uses `encodeURIComponent`: letters, digits, and `-_.!~*'()` stay literal; everything else becomes UTF-8 percent-encoded hex pairs. Encode parameter values only — not a complete URL with scheme and host.

Readiness: experimental

Input types: text

Output types: text

## Limits

- Characters are escaped to UTF-8 hex pairs.

## Warnings

- This tool escapes the full string. If you encode an entire URL (with its scheme and host), you will break the URL.

## Example

Input: a=b&c

Output: a%3Db%26c

## Steps

1. **Paste one parameter value** — Encode a single query value or path segment — not a complete URL with scheme and host.
2. **Run locally** — Reserved characters such as `&`, `=`, and spaces become percent-encoded UTF-8 pairs.
3. **Paste into the query string** — Copy the escaped string into your request or link builder.

## Encode values, not whole URLs

Paste `R&D` or `a=b&c`, not `https://example.com/?q=…`. Encoding an entire URL turns `:` and `/` into percent sequences and breaks the link.

## Spaces

Spaces become `%20`. If you are preparing `application/x-www-form-urlencoded` bodies that expect `+`, convert after encoding or use a form serializer instead.

## FAQ



### Why should I encode URL parameters?

Reserved characters like '&', '=', '?', and '#' have structural meaning in URLs. If your query string data contains these characters (e.g. searching for 'R&D'), it will truncate or break the URL unless properly percent-encoded as '%26'.

### Is this safe for full URLs?

No. This tool encodes the entire input string. If you paste a full URL (like 'https://example.com/'), the colon and slashes will be encoded, breaking the link. Only use this for individual parameter values.

### How are spaces handled?

Spaces are converted to their percent-encoded hexadecimal format ('%20'). While some application/x-www-form-urlencoded forms accept '+' for spaces, '%20' is the universal standard for URI components.
