binsize
Tool to analyze the size of a binary from .elf file
What it is and what it does
Binsize is a command-line tool that parses compiled ELF binaries and optional map files to report which symbols are consuming the most space. It wraps external analysis tools (bloaty and nm) and provides a CLI interface with subcommands for inspecting, comparing, and visualizing symbol sizes in a hierarchical tree view. The tool stores its configuration—including the project root directory—in a platform-specific settings file managed by platformdirs.
You interact with it primarily through shell commands like `binsize get`, `binsize compare`, and `binsize tree`, each with their own options. It can output results to the terminal or to a file, and allows you to set the project root directory via environment variable, CLI flag, or a Python function call if you're embedding it in a script.
Use it for:
- Identify which symbols are bloating a firmware binary and prioritize optimization efforts.
- Compare symbol sizes across two binary builds to detect regressions or improvements.
- Visualize the hierarchical breakdown of code and data sizes in a compiled ELF file.
- Automate binary size analysis in a build pipeline by setting root directory via environment variable.
- Debug unexpected size growth in a compiled artifact by drilling into symbol-level details.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Analyzes symbol sizes in compiled binaries by parsing ELF files and optional map files, helping developers identify which symbols consume the most space.
Yes, if you regularly analyze compiled binaries and need a lightweight CLI tool for symbol-level size profiling. The low install friction and permissive license make it a low-risk addition. However, be aware that maintenance is dormant and you will need to have `bloaty` and `nm` already available on your system—verify that dependency before committing to it.
Install
binsize on PyPI
pip
pip install binsizeuv
uv add binsizepoetry
poetry add binsizeInstalling binsize
Before you install
Low install friction with four lightweight runtime dependencies. Maintenance is dormant—last commit was 2023-07-27, though the package was updated on PyPI as recently as 2025-01-27. No active development signal, but no known issues either.
License in practice
MIT license is permissive and imposes no restrictions on use, modification, or distribution in your own projects.
Quickstart
pip install binsize
binsize get firmware.elf -d
binsize compare firmware.elf other_firmware.elf
binsize tree firmware.elf
Requires external tools `bloaty` and `nm` to be installed on the system; also requires setting a project root directory via BINSIZE_ROOT_DIR environment variable, settings.json, or CLI argument.
Verify before relying
- Whether `bloaty` and `nm` are typically pre-installed on target systems or require separate setup steps.
- Performance and accuracy of symbol size analysis on large or complex binaries.
- Whether the dormant maintenance status indicates the tool is stable or at risk of bit-rot with future toolchain changes.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — click, typing-extensions, termcolor, platformdirs |
| Maintenance | dormant — 564 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 138,108/month — #11,344 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: binsize-0.1.4-py3-none-any.whl
Keywords: binary size, code size, .elf file
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
mapfile_parserParses compiled binary map files (GNU ld, clang…
unclear · top 15,000 on PyPI
membrowseAnalyzes binary size and memory footprint of…
unclear · top 15,000 on PyPI
pyelftoolspyelftools parses and analyzes ELF binary files…
permissive · top 5,000 on PyPI
liefLIEF parses, modifies, and abstracts binary…
permissive · top 5,000 on PyPI
ropperRopper displays binary file metadata and…
permissive · top 15,000 on PyPI
smdaSMDA is a recursive disassembler library that…
permissive · top 15,000 on PyPI
malduckMalduck provides cryptographic, compression,…
copyleft · top 15,000 on PyPI
cleCLE loads binary executables and shared…
permissive · top 5,000 on PyPI
esp-coredumpRetrieves and analyzes core dumps from ESP32…
permissive · top 5,000 on PyPI
ROPGadgetROPGadget searches for ROP (Return-Oriented…
permissive · top 5,000 on PyPI