Base64 to CSS
Paste a Base64 string to get a ready-to-use CSS background-image rule or decoded stylesheet.
Last updated: May 29, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is Base64 to CSS?
Base64 to CSS decodes a Base64-encoded string and produces CSS output. When the decoded data is an image (PNG, JPEG, GIF, WebP), the tool wraps it in a CSS background-image: url(data:...) rule you can paste directly into your stylesheet. When the decoded data is CSS text, it returns the plain stylesheet.
How to Use Base64 to CSS
Paste a Base64 string into the input.
Click "Convert to CSS".
Copy the CSS output and paste it into your stylesheet.
Common Use Cases
- Converting a Base64-encoded PNG or WebP icon into a CSS background-image rule.
- Decoding a Base64-encoded CSS snippet retrieved from an API.
- Generating inline CSS for image assets without a separate HTTP request.
Example Input and Output
A Base64 PNG decoded to a CSS background-image rule.
iVBORw0KGgo=....element {
background-image: url("data:image/png;base64,iVBORw0KGgo=...");
background-repeat: no-repeat;
background-size: contain;
}Privacy
All processing runs in your browser. No data is sent to any server.

