Base64 in CSS

Any CSS property that accepts url() also accepts a data URI, so small images and fonts can live inside the stylesheet itself. Pick a property for syntax and examples.

General syntax

selector {
  property: url("data:<mime type>;base64,<Base64 data>");
}

Generate the full declaration with the Image to Base64 converter (choose “CSS background-image” as the output), or convert a whole stylesheet at once with the CSS Data URI Converter.

Related tools and guides

Comments (0)

Questions, ideas or a bug in “Base64 in CSS”? Leave a comment, rate the tool, or reply to others.

No comments yet. Be the first to share your feedback!

Leave a comment

Rate this tool:
Esc
↑ ↓ move↵ openEsc close