Protecting your code…

Universal Code Protector

Protect your CSS & JavaScript with multi-layer obfuscation and domain lock. Paste code or drop an HTML file β€” the type is auto-detected and inline CSS/JS are protected automatically.

πŸ”’ Domain Lock Protected code will only run on your domain(s)

Enter one domain or comma-separated multiple domains. https:// prefix is auto-removed.

main.js β€” Protected Detected: UNKNOWN 0 characters 0.00 KB
1
Ready to obfuscate...

πŸ”’ Privacy: Your code never leaves your browser (except loading the obfuscator library from CDN). All protection runs 100% locally.
⚠️ Honest note: Obfuscation makes code harder to read β€” it is not unbreakable encryption. Determined users can still reverse-engineer it.

Code Decoder / Formatter

Format, beautify, minify, validate and inspect code.

⚠️ Limitation: Not all obfuscated code can be restored to its original source β€” formatting makes it readable, it cannot undo real obfuscation.

JavaScript Formatter / Beautifier

Formats JavaScript with clean indentation.

JavaScript Minifier

Minifies JavaScript locally.

JavaScript Syntax Validator

Parses code with new Function() in try/catch β€” your code is never executed.

CSS Formatter / Beautifier

Formats CSS with clean indentation.

CSS Minifier

Minifies CSS locally.

CSS Validator

Checks brace / parenthesis balance and basic structure.

JSON Formatter

Parses and pretty-prints JSON (2-space indent).

Base64 Decode

Decodes a Base64 string back to text.

URL Decode

Decodes a URL-encoded string.

Remove Extra Whitespace

Collapses extra spaces, tabs and blank lines.

Code Inspection β€” Detect Encoded Strings

Finds common Base64 and URL-encoded strings in pasted code.

HTML Tools

Minify, format and encode HTML.

HTML Minifier

Removes comments and collapses whitespace.

HTML Formatter

Pretty-prints HTML with indentation.

HTML Entity Encoder

Encodes < > & " ' to entities.

HTML Entity Decoder

Decodes HTML entities back to characters.

CSS Tools

Minify and beautify CSS.

CSS Minifier

Minifies CSS locally.

CSS Beautifier / Formatter

Formats CSS with clean indentation.

JavaScript Tools

Minify, beautify and validate JavaScript.

JS Minifier

Minifies JavaScript locally.

JS Beautifier / Formatter

Formats JavaScript with clean indentation.

JS Validator

Syntax check only β€” code is parsed, never executed.

Encoding Tools

Base64 and URL encoding / decoding.

Base64 Encode

Unicode-safe Base64 encoding.

Base64 Decode

Decodes Base64 back to text.

URL Encode

encodeURIComponent encoding.

URL Decode

decodeURIComponent decoding.

Hash Generator

SHA hashes generated locally with Web Crypto (crypto.subtle).

SHA-256 Hash Generator

SHA-512 Hash Generator

Text Hash Generator

HTML Encrypt / Decrypt

Encrypt HTML into a document.write script. The encrypted output carries a credit comment with your website URL ().

Password Encrypt / Decrypt

Encrypt text with your own password using AES-GCM 256 + PBKDF2 (100,000 iterations, WebCrypto). Output is a portable package string starting with UCP1. β€” decrypt it anywhere with the same password. Everything runs locally; the password is never stored or sent anywhere.

⚠️ If you forget the password, the text cannot be recovered β€” AES-GCM authentication also means a wrong password or a tampered package will fail cleanly instead of producing garbage.

JWT Decoder

Decode a JSON Web Token's header and payload (base64url β†’ JSON). Expiry is shown when an exp claim is present.

Expiry info will appear here after decoding.

⚠️ This tool only decodes β€” it does not verify the signature. Never trust a JWT's contents without server-side verification.

HTML Live Editor / Preview

Write HTML, CSS and JavaScript in one document and preview it live in a sandboxed iframe. Preview updates as you type, or press Run anytime.

Help & Support

A beginner-friendly guide to every tool on this website. Follow the steps in order β€” no coding experience needed.

πŸ›‘οΈ How to protect JavaScript β€” step by step

  1. Go to Home / CSS & JS Protector from the menu (☰).
  2. Paste your JavaScript code into the big editor β€” or press πŸ“€ Upload File and choose a .js file (max 2 MB).
  3. The type is detected automatically (the chip says Detected: JS). You can also tap the JavaScript Protector tab to force it.
  4. Press πŸ›‘ Protect Code and wait a few seconds β€” the status line says β€œReady” when it is done.
  5. Your protected code appears in the Protected Output box below, with its size, time and status.
  6. Press πŸ“‹ Copy Output to copy it, or ⬇ Download Protected File to save it as a .js file and use it in your website.

πŸ’‘ Tip: the editor grows automatically as you paste more code. Press β›Ά Expand to make the editor fill the whole screen (press Esc or the same button to exit).

🎨 How to protect CSS β€” step by step

  1. Paste your CSS into the same editor β€” or upload a .css file.
  2. The chip changes to Detected: CSS (or tap the CSS Protector tab).
  3. Press πŸ›‘ Protect Code.
  4. Copy or download the output.

⚠️ Important: CSS protection output is a .js file, not a .css file. It is a small JavaScript program that injects your CSS into the page at runtime. Add it to your page with a <script src="protected.js"></script> tag instead of a <link> tag.

🌐 How to protect a full HTML file

  1. Paste a whole HTML page into the editor β€” or upload a .html file.
  2. The chip changes to Detected: HTML.
  3. Press πŸ›‘ Protect Code.
  4. The tool finds every inline <style> block and protects it as CSS, and every inline <script> block and protects it as JavaScript β€” then rebuilds your complete HTML page with the protected blocks inside.
  5. The status line tells you how many blocks were protected, for example β€œ2 CSS block(s), 3 JS block(s) protected”.
  6. Download the result as a .html file and open it β€” it works like the original page.

Scripts loaded from other files (<script src="...">) are left untouched β€” protect those .js files separately. If your HTML has no inline CSS or JavaScript, it is encrypted with HTML encryption instead (see below) and the status line says so.

πŸ”’ How Domain Lock works

  1. Turn the πŸ”’ Domain Lock switch ON.
  2. Type your domain, for example example.com (you do not need https:// β€” it is removed automatically).
  3. To allow more than one domain, separate them with commas: example.com, www.example.com, shop.example.com.
  4. Press πŸ›‘ Protect Code as usual.

The protected code checks the website address when it runs. On your allowed domain(s) it works normally. On any other domain it shows a β€œDomain Lock Active” message and the code does not run β€” so nobody can copy your file to their own website and use it. www.example.com is treated as the same as example.com.

πŸ“‹ Copy, Download & Upload

  1. πŸ“₯ Paste Code β€” pastes text from your clipboard into the editor.
  2. πŸ“‹ Copy Input β€” copies what you pasted, before protection.
  3. πŸ“€ Upload File β€” loads a .js, .css, .txt or .html file (max 2 MB) into the editor. Every tool on this website has its own Upload button that loads a file into that tool's input box.
  4. πŸ“‹ Copy Output β€” copies the protected result.
  5. ⬇ Download Protected File β€” saves the result with the correct extension (.js for JavaScript and CSS protection, .html for HTML protection).
  6. πŸ—‘ Clear code β€” clears the editor. If the code is long, the site asks for confirmation first.

πŸ” How to use HTML Encrypt / Decrypt

  1. Open HTML Encrypt / Decrypt from the menu.
  2. Paste a small HTML snippet (not a whole page) into the input box.
  3. Choose a mode: Normal (small output), Full (every character encoded, harder to read) or UTF-8 (best for emoji and other languages).
  4. Press πŸ” Encrypt. The output is a <script> that writes your HTML back when the page loads β€” paste it into your page's <body> where the content should appear. A credit comment with the website URL is added on top.
  5. Press β–Ά Run / Preview to see the result in a safe preview before you copy it.
  6. To get your original HTML back later, paste the encrypted script and press πŸ”“ Decrypt.

🧰 The other tools β€” at a glance

  • Code Decoder / Formatter β€” format, beautify, minify, validate and inspect JavaScript, CSS and JSON.
  • HTML Minifier / Formatter / Entity Encoder-Decoder β€” shrink or pretty-print HTML and convert special characters.
  • CSS Minifier / Beautifier β€” shrink or format CSS.
  • JavaScript Minifier / Beautifier / Validator β€” shrink, format or syntax-check JavaScript (validated code is never executed).
  • Base64 & URL Encoder / Decoder β€” convert text to Base64 or URL-safe form and back.
  • Hash Generator β€” SHA-256, SHA-512, SHA-1 and SHA-384 fingerprints of any text.
  • Password Encrypt / Decrypt β€” lock text with your own password (AES-GCM). If you forget the password, the text cannot be recovered.
  • JWT Decoder β€” read a token's header, payload and expiry (decoding only β€” the signature is not verified).
  • HTML Live Editor β€” write HTML, CSS and JavaScript and watch a live preview update as you type.

❔ Frequently Asked Questions

Is protection unbreakable?
No β€” and no honest tool can promise that. Obfuscation makes your code very hard to read and copy, but a determined person can still reverse-engineer it. Never put passwords, API keys or secrets in client-side code, protected or not.

Does my code leave my browser?
No. All processing happens locally in your browser. Your code is never sent to any server (only the obfuscation library is loaded once from the internet).

What if the protection library fails to load?
The site shows a clear error β€” β€œProtection library failed to load β€” check internet connection” β€” and produces no fake output. Reconnect to the internet and try again.

Why does my protected JavaScript not print to the console?
The protection engine disables console output inside protected code on purpose. Your code still runs β€” only its console.log messages are silenced.

Why is my module code (import / export) not wrapped?
Standalone JavaScript is wrapped so every name can be renamed. Module-style code (import, export, require, module.exports) is left unwrapped so its imports and exports keep working.

Can a decoder restore my protected code?
Formatting tools can make protected code easier to read, but they cannot restore your original source code.

πŸ’¬ Need more help? Contact Support

Stuck on something, found a bug, or want a new feature? Join the support channel and message the developer.

Developer: Sabbir Hasan

✈️ Support Channel β€” t.me/AIDeveloperCommunity

Support channel: https://t.me/AIDeveloperCommunity

About Developer

S

Sabbir Hasan

Developer of Universal Code Protector β€” a premium, privacy-first tool to protect CSS, JavaScript and HTML with domain lock and multi-layer obfuscation, running entirely in your browser.

Social links are configured in js/config.js. Buttons show β€œLink coming soon” until a real URL is added β€” no fake links.

Contact & Social Links

Reach the developer through the channels below.