A virtual teacher who reveals to you the great secrets of Base64

CSS to Base64

This online converter allows you to encode CSS to Base64. In most cases, you do not need to do this because you can use the <style> tag to embed CSS as “source code”. Perhaps, it may be useful if you need to embed a user CSS into an HTML page, but you do not want to deal with its escaping and validating. If you need to encode images from CSS to Base64 encoded data URI, use the CSS Data URI Converter.


How to convert CSS to Base64

  1. Type or paste your CSS into the “CSS source” field.
  2. If necessary, select the desired output format.
  3. Press the “Encode CSS to Base64” button.
  4. Download or copy the result from the “Base64” field.

Output formats

If you do not know what output format you need, check the following examples to see how will look the result of the same Base64-encoded CSS formatted in each of the available formats:

Plain text:
Ym9keSB7DQogIGNvbG9yOnJlZA0KfQ==
Data URI:
data:text/css;base64,Ym9keSB7DQogIGNvbG9yOnJlZA0KfQ==
HTML Hyperlink:
<a href="data:text/css;base64,Ym9keSB7DQogIGNvbG9yOnJlZA0KfQ=="></a>
HTML Style:
<style type="text/css">
  @import url("data:text/css;base64,Ym9keSB7DQogIGNvbG9yOnJlZA0KfQ==");
</style>
HTML Stylesheet:
<link rel="stylesheet" type="text/css" href="data:text/css;base64,Ym9keSB7DQogIGNvbG9yOnJlZA0KfQ==" />

If I missed an important output format for Base64-encoded CSS strings, please let me know — I would love to implement it.

Comments (2)

I hope you enjoy this discussion. In any case, I ask you to join it.

  • Subscribe,
    Awesome site! wait what? Where are the comments no work because there are no comments here i will try to comment!
  • nqhXncMU,
    1 waitfor delay '0:0:15' --
Add new comment

If you have any questions, remarks, need help, or just like this page, please feel free to let me know by leaving a comment using the form bellow.
I will be happy to read every comment and, if necessary, I will do my best to respond as quickly as possible. Of course, spammers are welcome only as readers.