Notepad calculator for Linux
Type a line, get the answer beside it. A notepad that does the math.
Babbage is a precision-first notepad calculator. Write sums in plain language with numbers, units, money and dates, and the answer appears next to each line as you type. Results stay exact until they can’t, say so when they aren’t, and every sheet is a plain text file you own.
A sheet is a list of lines. Names you define turn green, amounts pick up their own colors, and the answers sit in a column on the right.
Everything here works today.
Write what you mean: 150 lb in kg, 3 hours 20 minutes in seconds, 12 plus 3. Words around a calculation are ignored, so a line can read like a note.
Fractions stay fractions, so 1/3 + 1/6 is exactly one half. When an answer has to be rounded or approximated it is marked with a small ≈, and a power too big to hold exactly is approximated and marked, never silently.
20% of 85, 5% on $40, 180 is 10% off what, 50 to 75 is what %, and percentages that multiply and divide each other.
Over two hundred units with exact conversion factors: lengths, weights, volumes, speeds, energy, data, temperatures, fuel economy (8 L/100km in mpg), and compound units such as km/h.
Currency symbols and codes, your region’s dollar, a sales tax or VAT setting, and exchange rates you type in yourself. Babbage fetches no rates: a rate you don’t give it is a question, not a guess.
rent = $900 and use rent below it, or refer to an earlier answer with line3. Names are colored, hovering shows their value, and Esc or Tab finishes a name.
A Total chip adds the sheet up as you go and says which lines it left out. Subtotal lines, #tags and total of #food add up part of a sheet.
June 3 + 3 weeks, days until Christmas, 9am London in Tokyo, workdays (list your holidays and they are skipped), timestamps, ISO 8601, lap times and video timecode.
Compound interest, present value, loans and returns, written the way you would say them.
Roots, logarithms, trigonometry in degrees or radians, rounding, averages and medians, gcd and lcm, conditionals, and numbers in any base with bitwise operators.
The … beside an answer sets its decimal places, thousands separators, k/M notation or fixed money digits for that line alone. Hold Alt and drag a number to count it up or down.
Number format, currency, tax, the working day and holidays, the update check, colors, fonts, text and heading size. Everything saves to a plain settings file.
On Omarchy, Babbage follows the current theme, light or dark, live, and keeps every color readable on whatever the theme provides. Elsewhere it follows the system’s setting.
babbage --quick opens a small floating window for one sum, or brings the open window forward on Hyprland. On Omarchy, babbage setup omarchy adds a key and a menu entry in files of its own, with backups, and --remove takes them out again.
bbg answers a line, a sheet file or a pipe, prints JSON on request, and completes options and your sheet names with Tab in bash, zsh and fish.
Send a sheet out as text, CSV, HTML or PDF with Ctrl+Shift+E.
The installer downloads the latest release and checks every file
against its published SHA-256 before anything is installed. The
program goes under ~/.local, with two commands beside
it: babbage opens the window, and bbg
answers from the command line. It also adds a launcher entry with an
icon and tab completion for bbg. No root needed.
$ curl -fsSL https://github.com/jrimmer/babbage/releases/latest/download/install.sh | bash # then, from anywhere $ bbg 20% of 85 # 17 $ bbg 150 lb in kg # 68.0388555 kg $ bbg budget.bbg # a sheet file: every line answered $ echo "3 * \$4.50" | bbg # standard input is a sheet too
Run the same line again to update. Add --uninstall
after bash -s -- to remove it. Prefer to download by
hand? The release page has the AppImage and a tarball, each with a
.sha256 file; check one with sha256sum -c
and run it. To build from source, clone the repository and run
cargo build --release.
Each sheet is one plain .bbg file in your data folder
(~/.local/share/babbage by default), saved as you type.
Open it in any editor, back it up with the tools you already use, or
move it with mv.
# a sheet is the lines you typed $ cat ~/.local/share/babbage/Weekend\ trip.bbg # Weekend trip flights = $412 × 2 hotel = 3 × $138 …
A line’s own formatting from the … menu is kept at the end of the file and follows the line’s text, so editing a sheet elsewhere does not scramble it.
Babbage works offline, and the only thing it can do online is look for a newer version of itself. When it starts, at most once a week, it asks the release page for its list of releases. That request carries your IP address and nothing from your sheets or settings. If a newer version exists, an Update pill appears with the release notes and Install, Later and Skip buttons; nothing is downloaded until you press Install, and the file is checked against its published SHA-256 first.
Choose Off, Monthly, Weekly or Daily in Settings, or set
BABBAGE_UPDATES=off and Babbage never goes online. The
full list of what it asks, sends and keeps is in
docs/updates.md.
The calculation engine is a separate crate, babbage-core,
with no interface of its own. Hand it a line and it hands back an
exact value and how to show it.
$ cargo add babbage-core // in your program use babbage_core::{evaluate, format_value, FormatOptions}; let value = evaluate("20% of 85")?; let shown = format_value(&value, &FormatOptions::default()); assert_eq!(shown.text, "17");
The developer guide covers values, formatting, sheets, settings and what 1.x promises.