CSS to Base64
Paste a CSS stylesheet and get the Base64-encoded string in one click.
Last updated: May 29, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is CSS to Base64?
CSS to Base64 encodes a CSS stylesheet as a Base64 string. This is useful when you need to embed a stylesheet in a data URI (e.g., for a self-contained HTML file), pass CSS through an API that only accepts Base64 payloads, or store a stylesheet in a Base64-encoded configuration value.
How to Use CSS to Base64
Paste your CSS into the input.
Click "Encode to Base64".
Toggle URL-safe if needed.
Copy the output.
Common Use Cases
- Embedding a stylesheet in a data URI for use with an iframe srcdoc or object src.
- Passing CSS through a Base64-only API or webhook payload.
- Storing a stylesheet as a Base64 value in a JSON configuration file.
Example Input and Output
Encoding a simple CSS rule to Base64.
body { font-family: sans-serif; }Ym9keSB7IGZvbnQtZmFtaWx5OiBzYW5zLXNlcmlmOyB9Privacy
All encoding runs in your browser. No data is sent to any server.

