FREE ONLINE PYTHON OBFUSCATOR

Python obfuscator. Harder to read.

Turn readable Python into obfuscated source that still runs. Do a single file right here in your browser, or batch-obfuscate an entire project offline with the desktop app.

Free to useNo account requiredNothing stored
  1. 1 Paste Python or load the example
  2. 2 Choose transforms defaults are ready
  3. 3 Copy & test before you ship
ONLINE WORKSPACE

Source in. Obfuscated code out.

Customize transforms
01 Python source
0 lines · 0 charactersPython 3
02 Obfuscated output

                
Awaiting sourceobfuscated.py
or press Ctrl / ⌘ + Enter

Online processing sends your source to our server. Prefer to keep code on your machine? Use the desktop app or CLI.

Make it yours

Conservative defaults keep public names and docstrings intact.

2 transforms selected
Every transform can still be changed below.
DESKTOP APP · BATCH · CLI

Obfuscate a whole project in one run.

The desktop app points at a folder and obfuscates every .py in a single pass — mirror the tree to an output folder, write name.obf.py beside each file, or overwrite in place. Script the exact same run in your pipeline with the bundled pyobf CLI. Everything runs locally — your source never leaves your machine.

Whole-project batchOffline & privateCLI for CI/CD
Python Obfuscator — Batch + Add folder Scan Run all PROJECT FILES · 12 main.py3.2 KB api/client.py7.8 KB core/models.py12 KB utils.py2.1 KB cli.py4.4 KB db/schema.py9.0 KB PRESET Light Balanced Maximum TRANSFORMS Rename identifiers Encrypt strings Obfuscate numbers Encrypt loader 9 of 12 done · 148 KB → 92 KB

Conservative by default

Conservative defaults preserve public names and docstrings. Regression tests check runtime behavior; options that change public interfaces or metadata are off by default.

A stateless request

The online tool processes your source on the server and returns the result without saving your code. For local processing, use the desktop app or CLI.

Built for Python syntax

A purpose-built Python tokenizer understands indentation, f-strings, t-strings, decorators, match/case, walrus, and async — not fragile regexes.

What the Python obfuscator does

Obfuscation makes source harder to follow by changing names, removing explanatory text and encoding literals. The engine uses a Python tokenizer and scope analysis to apply the transforms you select:

  • Identifier renaming — local variables and parameters become opaque short names. The engine performs scope analysis so it renames only names it can prove are safe, never builtins, imported names, attributes, keyword arguments, or dunder methods.
  • Comment & docstring removal — strips explanatory text that leaks intent.
  • String encoding — moves string, f-string and bytes literals into an encrypted table decoded at runtime, so text isn’t readable or greppable in the file. Keep credentials and other secrets out of distributed code.
  • Number obfuscation — replaces integer literals (decimal, hex, octal, binary) and floats with exactly equal expressions.
  • Packed or encrypted loader — compresses (and optionally encrypts) the whole module into a small self-decoding loader.
  • Compaction — removes blank lines and minimizes spacing while preserving indentation semantics.

Why use a Python obfuscator?

Python ships as source, and even compiled .pyc files or PyInstaller executables can be turned back into readable code in minutes. A Python obfuscator is the simplest protection layer: the output is still plain Python that runs on any interpreter, with no build step or runtime to install, but the names, comments and literals that explain your logic are gone. Teams use it to protect scripts and plugins they hand to customers, code bundled into desktop apps, and tools deployed to machines they don’t control. For a step-by-step walkthrough, see how to obfuscate Python code; to compare approaches, see Nuitka vs Cython vs PyArmor vs obfuscation.

Note: Obfuscation raises the effort required to read your code; it is not encryption. Anyone who can run your Python can, with enough work, recover behavior. Combine obfuscation with server-side secrets and proper licensing for anything sensitive.

MORE TOOLS & GUIDES

Everything around protecting Python

Python minifier

Strip comments, docstrings and spacing to make Python smaller without changing what it does.

Python string encoder

Move URLs, messages and names into an encrypted table so they aren’t readable in the file.

Can obfuscation be reversed?

What an analyst can and can’t recover from each technique, answered honestly.

Hide an API key in Python

Environment variables, .env, keyring, a server-side proxy, and what obfuscation really hides.

Flask, Django & CLI apps

Settings tested against real Flask, Django, FastAPI, Click, Typer and pytest code.

Blender add-ons

Protect a paid add-on while Blender still lists, installs and registers it.

How to obfuscate Python

A step-by-step guide: one file online, a whole project offline, then test and ship safely.

PyArmor alternative

How source obfuscation compares with PyArmor, Nuitka and Cython, and when to use each.

Desktop app & CLI

Obfuscate every .py in a project offline, and script the same run in CI.

Protect Python source code

Six methods, from obfuscation to compiling and server-side code, and what each one actually stops.

Best Python obfuscators

The five kinds of protection tools and a five-question checklist for choosing one.

Obfuscate before PyInstaller

Protect the code inside your .exe, including the hidden-import fix.

Nuitka vs Cython vs PyArmor

Compilers, bytecode protection and obfuscation compared side by side.

BEFORE YOU SHIP

Common questions

See all answers
Is the obfuscated code guaranteed to still run?

With the default transforms, yes. Renaming is scope-aware and conservative: it only touches names proven to be function-local and rewrites them consistently. Every engine change is tested: the whole Python standard library must still compile after obfuscation, and a test corpus plus real Flask, Django, FastAPI, Click and pytest programs must behave identically. Options that carry a caveat (rename global functions, remove docstrings) are off by default and labeled.

Do you store or see my code?

No. The online tool is stateless: your source is obfuscated in the request and the result is returned — never persisted, logged, or shared. Closing the tab discards everything. For code that must never leave your machine, use the desktop app or CLI.

Will it break my f-strings or dynamic code?

F-string and t-string interpolations are protected — any name used inside {…} is preserved everywhere. Fully dynamic access (looking up a variable by string via eval, exec, or locals()) is not rewritten, so avoid renaming names you reach that way.

Is obfuscation the same as encryption?

No. Obfuscation increases the cost of reading and reverse-engineering your code; it does not make it secret from someone who can execute it. Use it as one layer alongside server-side secrets and licensing.

START NOW · FREE

Ship Python that’s harder to copy.

Obfuscate a single file online in seconds, or run the whole project offline with the desktop app and pyobf CLI on a paid plan. The online tool needs no account and stores nothing.