Generador de @font-face Base64
Incrusta una fuente directamente en tu CSS como un data URI Base64, así la página no necesita una petición de archivo de fuente separada. Suelta un archivo TTF, OTF, WOFF o WOFF2 y la regla @font-face lista para pegar se genera por ti.
Embedding a font is one of several inlining techniques, alongside the Image to Base64 Converter and the SVG to Base64 Converter. The stylesheet carrying the result can be reduced first with the CSS Minifier.
Cómo usar Font-face en Base64
- 1 Upload a font file — TTF, OTF, WOFF or WOFF2.
- 2 Choose which formats to inline, since a single file embeds as one data URI.
- 3 Set the `font-family` name and the weight and style the rule should declare.
- 4 Copy the complete `@font-face` rule into your stylesheet.
Cómo usarlo
Elige un archivo de fuente y define el nombre de familia, el peso y el estilo. La regla @font-face aparece con la fuente incrustada como data URI, y la vista previa de abajo muestra la fuente renderizándose de verdad. También puedes pegar una cadena Base64 directamente si ya tienes una.
- Soporte de TTF, OTF, WOFF, WOFF2 y EOT
- Arrastrar y soltar o explorar en busca de un archivo
- Vista previa en vivo usando la fuente incrustada
- font-display y unicode-range opcionales
- Aviso de tamaño para incrustaciones pesadas
Cuándo incrustar una fuente
Incrustar elimina un viaje de ida y vuelta de red y garantiza que la fuente está disponible, lo que encaja con fuentes de iconos pequeñas, una única fuente de display, o HTML sin conexión y de correo. Es una mala elección para familias grandes: Base64 infla un archivo en aproximadamente un tercio, y toda la carga va dentro del CSS, así que no se puede almacenar en caché por separado ni transmitir en streaming.
Preguntas frecuentes
Does inlining a font actually improve performance?
It removes a round trip and guarantees the font is available at first paint with no flash of unstyled text, which can genuinely help for a single small font such as an icon set or a decorative heading face. For a body font it almost always hurts: Base64 inflates the file by a third, the font can no longer be cached separately across pages, and it cannot be loaded in parallel with anything else because it is locked inside the CSS file.
Why does my inlined font fail to load in some browsers?
Two common causes. A compressed WOFF or WOFF2 file is binary, and if any step of the pipeline corrupted the bytes the data URI decodes to garbage that the font parser rejects. The other is the format hint: the `format()` value must match the actual file, so a WOFF2 payload declared as `format('woff')` may be refused even though the data is valid.
What about font licensing?
Inlining does not change the licence, and it can make enforcement harder for the foundry rather than easier. Web font licences typically permit embedding on a specific domain with a pageview limit; inlining the file into a stylesheet and shipping that file anywhere else is a separate distribution. Check the terms before embedding, particularly for commercial faces.
Herramientas de imagen y color relacionadas
También te puede interesar
Herramientas de otras categorías que suelen combinarse con Font-face en Base64: