binaryConverter — Number Base Converter
Convert between decimal, binary, hexadecimal and octal — all at once, in one command.
Available as a pip-installable Python CLI (numbase) and as a dependency-free Bash script.
✨ Features
- 🔄 All bases at once — enter a number in any base, see DEC / BIN / HEX / OCT simultaneously
- 🔍 Auto-detection — prefix-based input:
255,0b1010,0xFF,0o17(underscores allowed:1_000) - ♾️ Interactive or one-shot — a prompt for quick sessions, or a single command for scripts
- 📋 Clipboard support — result copied automatically (
wl-copy,xclip,xselorpbcopy), or--no-copy - 🔢 Arbitrary precision — the Python version handles numbers of any size
- 🔇 Script-friendly — plain output when piped or when
NO_COLORis set
📥 Installation
Python (recommended)
pip install numbase-converter
Bash (no dependencies)
git clone https://github.com/serber1990/binaryConverter.git
./binaryConverter/bash/binaryConverter.sh
🛠 Usage
One-shot mode
numbase 255
numbase 0xFF
numbase 0b11001010
numbase 0o377
╭──────────────────╮
│ DEC 255 │
│ BIN 1111 1111 │
│ HEX FF │
│ OCT 377 │
╰──────────────────╯
✔ Copied (BIN): 11111111
Interactive mode
numbase
Type numbers one after another; q (or Ctrl+D) quits.
Clipboard
By default the most useful counterpart is copied: the decimal value for binary input, the binary value otherwise.
numbase 255 --copy hex # copies FF
numbase 0xFF --copy dec # copies 255
numbase 255 --no-copy # leaves the clipboard alone
🎨 Input formats
| Format | Example | Description |
|---|---|---|
| Decimal | 255 |
Plain number (leading zeros are fine) |
| Binary | 0b11111111 |
Prefix 0b or 0B |
| Hexadecimal | 0xFF |
Prefix 0x or 0X |
| Octal | 0o377 |
Prefix 0o or 0O |
The Bash version accepts the same formats, both as an argument (binaryConverter.sh 0xFF) and at the prompt.
It is limited to 63-bit values (max 9223372036854775807); larger numbers are rejected with a clear error.
🗂 Repository structure
binaryConverter/
├── numbase.py Python CLI (pip-installable as numbase)
├── bash/
│ └── binaryConverter.sh Bash version
├── python/
│ └── binaryConverter.py Compatibility shim → numbase
└── tests/ pytest suite (Python + Bash)
🧪 Development
pip install -e ".[dev]"
ruff check .
pytest
shellcheck bash/binaryConverter.sh
See CHANGELOG.md for release notes.
📝 License
MIT — see LICENSE.
💬 Feedback
Open an issue or reach out via GitHub.
🌐 Connect
Release files for numbase-converter 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| numbase_converter-2.1.0.tar.gz | 8.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| numbase_converter-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.3 kB
Release files / numbase_converter-2.1.0.tar.gz
| Download URL | numbase_converter-2.1.0.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96ac0e57c0972dcb5de442d76621c7e7d3dd2d6b36df628e4cc0cc0d662bd64a
|
|
BLAKE2b-256 checksum How to use checksums |
d53b5af5a0ebf653b0bb52293175ec93e0f8e50096c21c749683b7f2c1240880
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / numbase_converter-2.1.0-py3-none-any.whl
| Download URL | numbase_converter-2.1.0-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4fff89e2a0ada05a5bf5975af68149d5c782c15883ca928650f9fd1855fb8183
|
|
BLAKE2b-256 checksum How to use checksums |
90f1f8b66fd928fb1cd22a47740cc19f85eb0dd53f232ed3adfbf3e78af84556
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|