Skip to main content
Guides

What Is PyArmor? How It Works, Pricing, and Free Alternatives (Tested)

By Mithun··10 min read
Quick Answer

PyArmor is a commercial command-line tool that obfuscates and encrypts Python scripts so they're hard to read or reverse-engineer. Unlike plain .pyc or PyInstaller, it wraps your code in an encrypted blob loaded by a native runtime (pyarmor_runtime.pyd/.so), so there's no readable bytecode to decompile. It has a free trial (pip install pyarmor) with limits; paid perpetual licenses run $52 (Basic) to $158 (Group) as of August 2026. Free alternatives include AST obfuscators (like our Python Obfuscator) and native compilers (Nuitka, Cython).

If you've looked into protecting a Python program from copying or reverse-engineering, you've hit PyArmor — it's the most established commercial tool for the job. But its docs are dense, the pricing isn't obvious, and it's not clear what the free version actually gives you or how it differs from just shipping a .pyc.

So I installed it (PyArmor 9.2.6), obfuscated a real script, and looked at exactly what it produces — then pulled the current pricing and lined it up against the honest free alternatives. Real output, no marketing. Here's what PyArmor is and whether you need it.

What PyArmor actually is

PyArmor is a command-line obfuscator for Python made by Dashingsoft. You point it at your scripts and it returns a protected version that runs the same but is deliberately hard to read, decompile, or tamper with. It's been around for years and is the default answer to "how do I stop people reading my Python?" — because, unlike most alternatives, it doesn't just rearrange your source.

The important idea: PyArmor doesn't leave normal Python (or normal bytecode) on disk. It transforms your code into an encrypted payload that only its own native runtime extension can load and execute. That runtime is a compiled C module (pyarmor_runtime.pyd on Windows, .so on Linux/macOS), which is why the result resists the decompilers that make plain .pyc and PyInstaller trivial to reverse — as I've shown in can .pyc files be decompiled and decompiling a PyInstaller exe.

What it does to your code (a real test)

I installed the free trial (pip install pyarmor) and obfuscated this small 490-byte "licensed" script — it has a hard-coded API key and a license check, the two things people most want hidden:

import sys
API_KEY = "sk-lictool-4b7d92e1a0"
LICENSE_CODE = "LT-PRO-2026-5590"
def check_license(code: str) -> bool:
return code == LICENSE_CODE
def greet(user: str) -> str:
return f"welcome {user}"
def main():
code = sys.argv[1] if len(sys.argv) > 1 else ""
if not check_license(code):
print("access denied"); return
print(greet("mithun"))
if __name__ == "__main__":
main()
lictool.py — the script I obfuscated
INFO start to generate runtime files
INFO target platforms {'windows.amd64'}
INFO write dist\pyarmor_runtime_000000\pyarmor_runtime.pyd
INFO obfuscating file lictool.py
INFO write dist\lictool.py
INFO obfuscate scripts OK
pyarmor gen lictool.py — the real output

It produced a dist/ folder with two things: my lictool.py (now obfuscated) and a pyarmor_runtime_000000/ package containing a 632 KB native `pyarmor_runtime.pyd`. The obfuscated lictool.py is no longer my code at all — it's a 7,510-byte bootstrap that hands an encrypted byte-string to the runtime:

# Pyarmor 9.2.6 (trial), 000000, non-profits, 2026-08-16
from pyarmor_runtime_000000 import __pyarmor__
__pyarmor__(__name__, __file__, b'PY000000\x00\x03\x0b\x00\xa7\r\r\n\x80\x00\x01\x00 ...about 7 KB of encrypted bytes... ')
dist/lictool.py — what PyArmor leaves on disk

It still runs exactly like the original — python lictool.py LT-PRO-2026-5590 prints welcome mithun — but your logic now lives inside that encrypted blob, decrypted in memory by the C runtime at execution time.

Does it actually protect the code? (yes — honestly)

This is where PyArmor genuinely differs from .pyc/PyInstaller. With a plain PyInstaller build, grep finds your hard-coded secrets in the extracted bytecode in plaintext. With PyArmor, the same search finds nothing — in either the obfuscated .py or the native runtime:

$ grep -c "LT-PRO-2026-5590" dist/lictool.py
0
$ grep -c "sk-lictool-4b7d92e1a0" dist/pyarmor_runtime_000000/pyarmor_runtime.pyd
0
grep for the secrets in PyArmor output — 0 hits

And because there's no standard .pyc on disk — just an encrypted payload — the usual decompilers (pycdc, uncompyle6) have nothing to work on. That's a real step up: PyArmor is legitimately one of the stronger off-the-shelf ways to protect a Python script.

Honest caveat: "stronger" is not "unbreakable." The interpreter must eventually run real code, so a determined attacker with a debugger can still analyze a PyArmor-protected program at runtime — there's an active cat-and-mouse community around it. It raises the cost of reverse-engineering a lot; it doesn't make it impossible. See is Python obfuscation secure?.

The free trial — what you get, and its limits

pip install pyarmor gives you a free trial that doesn't expire — the basic pyarmor gen obfuscation above works with no payment. But the trial deliberately holds back the stronger modes. Its own pyarmor -v spells out the limits:

Pyarmor 9.2.6 (trial), 000000, non-profits
BCC Mode : No
RFT Mode : No
CI/CD Mode : No
Notes
* Can't obfuscate big script and mix str
pyarmor -v (trial) — the gated features
  • No RFT mode — Reform Table renaming (renames functions/classes/variables) is Pro-only.
  • No BCC mode — the strongest option, which converts Python functions to C machine code, is Pro-only.
  • Big-script and string-mixing limits — the trial refuses to obfuscate large modules or apply string encryption freely.

So the free trial is genuinely useful for a small script, but the headline protection features people buy PyArmor for are behind a license.

PyArmor pricing (2026)

PyArmor is a pay-once, perpetual license (except CI) — the version you buy keeps working, though future major versions may need a new purchase. As of August 2026, from the official store:

LicensePrice (USD)Unlocks
Basic$52Obfuscate large scripts + string mixing; 100 build devices
Pro$89Everything in Basic + RFT (renaming) + BCC (Python → C machine code)
Group$158Offline builds, 200 build devices, unlimited local Docker
CI$90 / yrCI/CD pipeline use (rate-limited); the only subscription tier

For most solo developers who want the real protection (BCC/RFT), Pro at $89 is the relevant tier. Prices change, so confirm on PyArmor's official site before buying — and note licensing is per build-device, not per shipped copy.

Free alternatives to PyArmor (and the honest trade-offs)

If you don't want to pay, there's no free tool that exactly matches PyArmor Pro's encrypted-runtime + BCC model. But depending on your threat model, you have real free options:

OptionCostApproachvs PyArmor
Pyobfuscate (ours)FreeAST obfuscation: rename, string-encrypt, flatten flow; pure-Python outputNo runtime dependency and no install, but no native-runtime encryption — a lower bar than PyArmor Pro
NuitkaFreeCompiles Python to C, then to a real native binaryStrong (ships machine code), but heavier builds and larger output; not a drop-in obfuscator
CythonFreeCompile modules to native .pyd/.soGood barrier for the compiled parts; needs a build toolchain and code changes
PyArmor free trialFreeSame tool, basic mode onlyReal PyArmor protection for small scripts, minus RFT/BCC

The honest positioning: our free Python Obfuscator is the fastest no-install, no-cost way to make a script meaningfully harder to read (it renames identifiers and encrypts strings at the AST level and outputs standalone Python with no runtime to ship). It's a lower bar than PyArmor Pro's encrypted runtime, but it's free, browser-based, and adds no .pyd dependency. For a higher bar without paying, compiling with Nuitka or Cython ships actual machine code. We break the whole spectrum down in PyArmor vs Nuitka vs Cython vs Pyobfuscate.

Should you use PyArmor?

  • Use PyArmor (Pro) if you're shipping commercial software where source protection genuinely matters and you want the strongest off-the-shelf option — BCC mode compiling functions to C is a real barrier, and $89 once is cheap versus building it yourself.
  • Use the free trial if you just need to protect a small script and can live without RFT/BCC.
  • Use a free AST obfuscator like ours if you want to deter casual copying with zero cost, zero install, and no native runtime to bundle — good for scripts, bots, and freelance deliverables.
  • Use Nuitka/Cython if you're comfortable with a build step and want native machine code without a per-device license.

Whatever you pick, remember the universal rule the tests keep proving: don't hard-code real secrets in client-side code — obfuscation raises the cost of reading them but the program still has to decrypt them to run. Keep keys server-side (see protecting API keys in Python).

Obfuscate Python free — no install, no license

Prefer a free, browser-based option? Our AST Python Obfuscator renames identifiers and encrypts strings, then hands back standalone Python — no runtime to ship.

Open the Python Obfuscator

Free tools mentioned here

Related guides

Frequently asked questions

What is PyArmor used for?

PyArmor is a commercial command-line tool for obfuscating and encrypting Python scripts so they're hard to read, decompile, or tamper with. It's used to protect proprietary Python software — commercial CLI tools, bots, and paid applications — before distributing them. Unlike shipping a .pyc, it wraps your code in an encrypted payload loaded by a native runtime, so there's no readable bytecode left on disk.

Is PyArmor free?

PyArmor has a free trial you install with pip install pyarmor, and its basic obfuscation (pyarmor gen) works with no payment and no expiration. But the stronger modes are gated: RFT (renaming) and BCC (compiling Python functions to C machine code) require a paid Pro license, and the trial can't obfuscate large scripts or mix strings freely. Paid perpetual licenses run about $52 (Basic) to $158 (Group) as of 2026.

How much does PyArmor cost?

As of August 2026, PyArmor's pay-once perpetual licenses are roughly $52 for Basic, $89 for Pro (which unlocks RFT renaming and BCC machine-code mode), and $158 for Group (offline builds, more devices). There's also a CI license at about $90/year for pipelines — the only subscription tier. Pricing is per build device and can change, so check the official site.

Can PyArmor be decompiled or deobfuscated?

It's much harder than a plain .pyc. PyArmor doesn't leave standard bytecode on disk — your code becomes an encrypted blob decrypted in memory by a native C runtime, so decompilers like pycdc and uncompyle6 have nothing to work on. It isn't unbreakable (the code must run eventually, so runtime analysis with a debugger is possible), but it raises the reverse-engineering cost far above shipping .pyc or a PyInstaller exe.

What is a good free alternative to PyArmor?

There's no free tool that exactly matches PyArmor Pro's encrypted-runtime and BCC modes, but there are real options: a free AST obfuscator like our Python Obfuscator (renames identifiers and encrypts strings, outputs standalone Python with no runtime dependency) for a quick no-install deterrent, or native compilers Nuitka and Cython, which ship actual machine code for a higher bar at the cost of a build step. PyArmor's own free trial also works for small scripts.

Is PyArmor safe to use?

Yes — PyArmor is a widely used, legitimate commercial tool, and the obfuscated output runs your program normally via its bundled native runtime. "Safe" in the security sense: it genuinely hides source and string constants (in testing, grep found no hard-coded secrets in its output), but no obfuscator makes code impossible to reverse, so don't treat it as encryption for real secrets — keep those server-side.

Keep reading