# URL encoder and parser

> Encode or decode a URL, then break the query string into parameters.

Free URL encoder and decoder. Percent-encode a component or a whole URL, decode it again, and parse a URL into its host, path, and query parameters. Edit the query and copy the rebuilt URL. Runs in the browser.

- Page: https://benchline.fabwaseem.com/t/url-codec
- Runs: in the browser. Input stays on the device.
- Price: free, no account
- Input: Text to encode or decode, or a URL or query string to parse.
- Output: Encoded or decoded text, URL parts, and a query string rebuilt from the parameter table.
- Keywords: url decode, url encode, query string parser, url encoder
- Updated: 2026-10-18
- Built by: Waseem Anjum (https://fabwaseem.com)

## How to use it

1. **Encode or decode.** Pick component encoding to escape one value, or full encoding to escape a whole URL. Decode turns percent-escapes back into text.
2. **Paste a URL to parse it.** The host, port, path, and hash are listed beside the query parameters. A bare query string works too.
3. **Edit the query and copy the URL.** Change a parameter or add UTM fields. The rebuilt URL uses %20 for spaces.

## Use it from an AI agent

MCP tool name: `url_codec`
MCP endpoint: https://benchline.fabwaseem.com/mcp (Streamable HTTP, no key)
HTTP: POST https://benchline.fabwaseem.com/api/v1/tools/url-codec with the input as the JSON body
This call does not fetch anything. It runs on the arguments you send.

Percent-encode or decode text, or parse a URL into its host, path, hash, and query parameters.

### Input schema

```json
{
  "type": "object",
  "properties": {
    "action": {
      "default": "parse",
      "type": "string",
      "enum": [
        "encode",
        "decode",
        "parse"
      ]
    },
    "value": {
      "type": "string"
    },
    "mode": {
      "default": "component",
      "type": "string",
      "enum": [
        "component",
        "full"
      ]
    },
    "plusAsSpace": {
      "default": false,
      "description": "When decoding, treat + as a space.",
      "type": "boolean"
    }
  },
  "required": [
    "action",
    "value",
    "mode",
    "plusAsSpace"
  ],
  "additionalProperties": false
}
```

### Example tools/call

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "url_codec",
    "arguments": {
      "action": "parse",
      "value": "example",
      "mode": "component",
      "plusAsSpace": false
    }
  }
}
```

Setup for Claude, Cursor, and VS Code: https://benchline.fabwaseem.com/mcp/guide

## Questions

### What is the difference between component and full encoding?

Component encoding is encodeURIComponent: it escapes /, ?, &, and =. Full encoding is encodeURI: it leaves those URL separators in place and escapes spaces and other unsafe characters.

### Why does a plus sign become a space?

In a query string, + means space. Turn on Treat + as space when decoding a query. A literal plus in a path is %2B.

### Can I edit the parameters?

Yes. The parser lists each parameter. Change a value, add a row, or fill the UTM fields, and the URL is rebuilt with encodeURIComponent.

### Is the URL sent anywhere?

No. Encoding, decoding, and parsing use the browser's URL APIs.

## Related tools

- [Hash generator](https://benchline.fabwaseem.com/t/hash-generator): MD5, SHA-1, SHA-256, and SHA-512 checksums for text or a file, with HMAC.
- [JWT decoder](https://benchline.fabwaseem.com/t/jwt-decoder): Paste a JSON Web Token, read the claims, and verify the signature in the browser.
- [UUID generator](https://benchline.fabwaseem.com/t/uuid-generator): Generate UUID v4 or v7 in bulk, and read the time stored in a v7 id.
- [Unix timestamp converter](https://benchline.fabwaseem.com/t/unix-timestamp): Turn epoch seconds or milliseconds into a date, and a date in any time zone back into epoch time.
