CSS to Base64

Convert a stylesheet into a Base64 data URI that can be loaded with a <link> tag or @import. To inline the images inside a stylesheet instead, use the CSS data URI converter.

How to convert CSS to Base64 online

  1. Paste your CSS.
  2. Choose the output format.
  3. Click Encode CSS to Base64.

Output formats

Choose how the result should be wrapped. The converter can return:

  • txt: only the Base64 string, ready to paste into code, a database field or an API request.
  • uri: a complete data: URI that you can paste in a browser address bar or use anywhere a URL is accepted.
  • html link: a <link rel="stylesheet"> tag loading the encoded stylesheet.
  • html style: a <style> block that imports the encoded stylesheet.

Frequently asked questions

How do I load Base64 CSS?

Use <link rel="stylesheet" href="data:text/css;base64,...">.

Related tools and guides

Comments (0)

Questions, ideas or a bug in “CSS to Base64”? 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