URL Encode YAML
URL-encode YAML data for safe use in URLs and query strings. Converts special characters to percent-encoded format.
Paste raw YAML into a URL and watch it break — colons, spaces, and newlines all get misread as URL structure. This tool percent-encodes your YAML so it fits safely into query strings, webhook payloads, and API calls without mangling the data. And everything runs in your browser. Nothing gets uploaded.
How It Works
Under the hood, it's JavaScript's encodeURIComponent() function. Each character that isn't a letter, digit, or one of - _ . ~ ! * ' ( ) gets converted to a percent sign followed by two hex digits. A space becomes %20, a colon becomes %3A, a newline becomes %0A. The output is one long string that any URL parser will accept without choking.
Examples
Simple Key-Value Config
Passing a basic app config through a URL parameter.
app: myservice
port: 8080
debug: true
app%3A%20myservice%0Aport%3A%208080%0Adebug%3A%20true
Nested Docker Compose Snippet
You want to share a service definition via a webhook or chat link. The nested indentation and special characters would destroy the URL without encoding.
services:
web:
image: nginx:latest
ports:
- "80:80"
services%3A%0A%20%20web%3A%0A%20%20%20%20image%3A%20nginx%3Alatest%0A%20%20%20%20ports%3A%0A%20%20%20%20%20%20-%20%2280%3A80%22
GitHub Actions Environment Variables
Encoding a CI config block to embed in a deployment API call.
env:
NODE_ENV: production
API_URL: https://api.example.com
env%3A%0A%20%20NODE_ENV%3A%20production%0A%20%20API_URL%3A%20https%3A%2F%2Fapi.example.com
Who Uses This
Encoding Kubernetes manifests and Helm values to pass through CI/CD pipeline URLs.
Stuffing config snippets into API query parameters during testing and debugging.
Crafting encoded payloads for webhook tests and integration test URLs.
Creating pre-filled example links in documentation that include YAML config samples.
Common Mistakes
If your YAML already contains %20 or %3A and you encode it again, those percent signs get encoded too — turning %20 into %2520. Always start from raw YAML, not pre-encoded text.
Only encode the YAML data itself — the part going into the parameter. If you encode https://example.com?config= along with it, you'll break the URL structure completely.
This encoder doesn't check if your YAML is valid. It encodes whatever you paste — typos, broken indentation, and all. Validate your YAML first if correctness matters.
Technical Details
- Processing: 100% client-side — JavaScript's encodeURIComponent()
- Browser Support: Chrome, Firefox, Safari, Edge
- Encoding Standard: RFC 3986 percent-encoding
- Input Limit: No hard limit — depends on browser memory
- Output Format: UTF-8 percent-encoded string
Frequently Asked Questions
What is URL encoding and why does YAML need it?
URL encoding replaces characters that have special meaning in URLs (like :, /, spaces, and newlines) with percent-encoded equivalents. YAML is full of these characters — colons separate keys from values, spaces handle indentation, and newlines separate entries. Without encoding, pasting YAML into a URL breaks it instantly.
Can I decode the output back to original YAML?
Yes. Use any URL decoder — or run decodeURIComponent() in your browser console. The encoding is fully reversible. Every %XX sequence maps back to exactly one character, so you get your original YAML back, indentation and all.
Is there a size limit for the YAML I can encode?
The tool itself has no hard limit — it encodes as much text as your browser can handle. That said, most URLs have a practical limit around 2,000-8,000 characters depending on the server. If your encoded output is huge, consider sending the YAML as a POST body instead of a URL parameter.
What's the difference between encodeURI and encodeURIComponent?
encodeURI() leaves characters like :, /, ?, and # alone because they're valid URL structure characters. encodeURIComponent() — which this tool uses — encodes everything except letters, digits, and a handful of safe symbols. For YAML going into a query parameter, you want encodeURIComponent so colons and slashes don't get misread as URL structure.
Is my YAML data safe? Does it get sent anywhere?
Completely safe. The encoding runs in your browser using JavaScript — no server requests, no data storage, no analytics on your input. Close the tab and it's gone. You can even disconnect from the internet and the tool still works.