Menu

Font File Obfuscator

XOR-encrypt TTF, OTF, or WOFF2 font files and generate the JavaScript loader that decrypts them in the browser. Uses FontFace API + temporary Blob URLs so the font never appears as a direct file link.

Font File Obfuscator Studio XOR + FontFace
Ready

Drop a font file here or click to browse

TTF, OTF, WOFF, WOFF2 — max 10 MB

Everything is processed locally. Nothing is uploaded.
How it works: The font file is XOR-encrypted byte-by-byte with a key. The encrypted bytes are served as a .bin or .txt file. A small JavaScript loader fetches the encrypted bytes, XORs them back with the same key, creates a Blob, generates a temporary blob: URL, and registers the font via FontFace. The original font file is never exposed as a direct URL.
This is not encryption. The browser must decrypt the font to render it, so the key is present in your JavaScript. Determined users can extract the decrypted font from DevTools or memory. This raises the bar against casual scraping and hotlinking — it does not make the font unstealable [citation:3][citation:29].
Complete Guide to Font File Obfuscation

What Font File Obfuscation Actually Does

Font obfuscation transforms a font file so it cannot be used directly if someone downloads it. The most common approach for web fonts is:

  1. XOR-encrypt the font bytes with a secret key.
  2. Serve the encrypted bytes as a generic file (e.g., .bin) — not as a .ttf or .woff2.
  3. Decrypt in JavaScript when the page loads.
  4. Load via FontFace + Blob URL so the font is never registered from a direct URL [citation:3][citation:29].

The result: a bot that crawls your CSS and downloads every .woff2 file gets nothing useful. A human user sees the correct font. But a determined reverse engineer can still extract the decrypted font from browser memory or DevTools.

What This Tool Generates

OutputWhat It IsWhere to Put It
Encrypted font (.bin)XOR-encrypted bytes, served as a generic binaryYour server, e.g. /fonts/secret.bin
JavaScript loaderFetches the .bin, decrypts, creates Blob URL, loads FontFaceYour page or a bundled JS file

The JavaScript Loader Explained

The generated loader does the following:

// 1. Fetch the encrypted bytes
const res = await fetch('/fonts/secret.bin');
const encrypted = new Uint8Array(await res.arrayBuffer());

// 2. XOR-decrypt with the same key
const key = new TextEncoder().encode('your-secret-key');
const decrypted = new Uint8Array(encrypted.length);
for (let i = 0; i < encrypted.length; i++) {
  decrypted[i] = encrypted[i] ^ key[i % key.length];
}

// 3. Create a Blob and a temporary URL
const blob = new Blob([decrypted], { type: 'font/ttf' });
const url = URL.createObjectURL(blob);

// 4. Load via FontFace API
const face = new FontFace('MyProtectedFont', `url(${url})`);
await face.load();
document.fonts.add(face);

// 5. Revoke the URL (font stays in memory)
URL.revokeObjectURL(url);

Because the URL is a blob: URL that is revoked immediately after loading, the font never appears as a persistent, downloadable file in the Network tab [citation:3].

What Font Obfuscation Cannot Do

  • It cannot make the font unstealable. The browser must decrypt and use the font. A determined user can dump the decrypted bytes from memory [citation:3][citation:29].
  • It cannot stop hotlinking if the encrypted file is public. If someone finds your .bin, they can still download it — they just can't use it as a font without your key.
  • It cannot replace font licensing. This is a technical deterrent, not a legal one. Always enforce your font licenses.
  • It cannot work without JavaScript. Users with JS disabled will see fallback fonts. Always specify fallbacks in CSS.

Font Subsetting — The Stronger Protection

The most effective way to protect a font is to subset it — strip away every glyph your site does not use [citation:5]. A stolen subset font is far less useful than the full font. Combine this with XOR obfuscation for the best practical protection. Tools like pyftsubset (fonttools) can generate a subset before you obfuscate.

Legal & Licensing Reality

Many font licenses prohibit modification, including encryption or subsetting. Before obfuscating a font:

  • Check the license — does it allow modification or subsetting?
  • Some licenses (e.g., SIL OFL) allow modification but prohibit using the Reserved Font Name.
  • Commercial fonts often prohibit any modification — contact the foundry.

Frequently Asked Questions

Is font obfuscation secure?
No. It is a deterrent, not security. The browser must decrypt the font to render it, so the key is always present in your JavaScript. A determined user can extract the decrypted font from memory or DevTools [citation:3][citation:29].
How does XOR encryption work here?
Each byte of the font file is XORed with a byte from the key (repeating). XOR is reversible with the same key. It is not cryptographically secure, but it makes the file unusable as a font without the key.
Why use FontFace + Blob URL instead of @font-face?
A traditional @font-face points to a URL that anyone can find in the Network tab. FontFace + Blob URL creates the font from memory, so no persistent URL exists to download [citation:3].
Can I use this with WOFF2?
Yes. WOFF2 is already compressed, so the XOR-encrypted .bin file will be roughly the same size. The loader must specify the correct MIME type (font/woff2) when creating the Blob.
Does this affect performance?
Slightly. The browser must download the encrypted file, decrypt it in JavaScript, and create the FontFace. For a 100 KB font, the overhead is a few milliseconds. The bigger cost is the ~33% size increase from serving the encrypted binary as Base64 if you choose that option — serve it as raw binary instead.
What happens if JavaScript is disabled?
The font won't load. The user sees your CSS fallback fonts. Always specify a fallback stack in your CSS, e.g. font-family: 'MyProtectedFont', Arial, sans-serif;.
Can I use different keys for different fonts?
Yes. Each font should have its own key. The loader you generate includes the key, so you can generate multiple loaders for multiple fonts.
Is my font uploaded to your server?
No. Everything runs in your browser using the FileReader API. Your font never leaves your device.
Can I obfuscate variable fonts?
Yes. Variable fonts (TTF/OTF with variation axes) are just font files. XOR encryption works on the raw bytes regardless of the font's internal structure.
Does this work with CORS?
The fetch() call to download the .bin must be same-origin or CORS-enabled. If your font is on a CDN, configure CORS headers on the CDN. Alternatively, inline the encrypted bytes as Base64 in your JavaScript.
Can someone steal the font by modifying the loader?
Yes. If they have your JavaScript, they have your key. They can run the decryption themselves and save the result. Obfuscating the loader (using your JS AST Obfuscator tool) makes this harder but not impossible.

Related Tools