#️⃣

Multi-Format Encoder

Encode or decode strings using Base64, URL, HTML entities, hex, or ASCII85.

POST 1 credit /v1/auth/encode
curl -X POST "https://auth.toolkitapi.io/v1/auth/encode" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "data": "Hello, World! <script>alert(1)</script>",
    "encoding": "html_entities",
    "decode": false
  }'
import httpx

resp = httpx.post(
    "https://auth.toolkitapi.io/v1/auth/encode",
    json={
    "data": "Hello, World! <script>alert(1)</script>",
    "encoding": "html_entities",
    "decode": false
  },
)
print(resp.json())
const resp = await fetch("https://auth.toolkitapi.io/v1/auth/encode", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "data": "Hello, World! <script>alert(1)</script>",
    "encoding": "html_entities",
    "decode": false
  }),
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
{
  "encoding": "html_entities",
  "mode": "encode",
  "result": "Hello, World! &lt;script&gt;alert(1)&lt;/script&gt;"
}

Try It Live

Live Demo

Description

Encode or decode strings using Base64, URL, HTML entities, hex, or ASCII85.

How to Use

1

1. Set the `data` field to the string you want to encode or decode.

2

2. Choose an `encoding` format: `base64`, `base64url`, `url`, `html_entities`, `hex`, or `ascii85`.

3

3. Set `decode` to `true` if you want to reverse the encoding. Default is `false` (encode).

4

4. Send a POST request and use the `result` from the response.

About This Tool

The Multi-Format Encoder is a versatile endpoint that handles encoding and decoding across six different formats: Base64, Base64 URL-safe, URL encoding, HTML entities, hexadecimal, and ASCII85. A single endpoint replaces the need for multiple encoding utilities.

Set the `decode` flag to `true` to reverse any encoding. This makes it a bidirectional tool — encode data before storage or transmission, then decode it when you need the original value back.

This endpoint is particularly useful for sanitizing user input (HTML entities), preparing data for URLs (URL encoding), or converting between binary representations (hex, ASCII85).

Why Use This Tool

Frequently Asked Questions

When should I use this versus the dedicated Base64 endpoints?
Use this endpoint when you need flexibility across multiple formats or when building encoding pipelines. Use the dedicated Base64 endpoints if you only need Base64 and want a simpler interface.
What is ASCII85 encoding?
ASCII85 (also called Base85) is a more compact encoding than Base64 — it produces about 25% less overhead. It's used in Adobe PDF files and PostScript. Each group of 4 bytes becomes 5 ASCII characters.
Is URL encoding the same as percent-encoding?
Yes. URL encoding (also called percent-encoding) replaces unsafe characters with `%XX` hex sequences. This endpoint uses Python's `urllib.parse.quote` with no safe characters, encoding everything except unreserved characters.
Can I chain multiple encodings?
Not in a single request, but you can call the endpoint multiple times — for example, first hex-encode, then Base64-encode the result.

Start using Multi-Format Encoder now

Get your free API key and make your first request in under a minute.