Convert Numbers With numfmt

Turn byte counts into 1G/1M form, or parse human units back to raw numbers.

LinuxTerminalscriptingLow risk
Run numfmt --to=iec 1073741824 to print 1.0G.

01Command

Command
$ numfmt --to=iec 1073741824

02What it does

numfmt is a coreutils helper for converting between plain numbers and SI or IEC units. Use --to=iec for binary units such as 1.0G, --from=si to parse a value like 1M, and combine it with awk in pipelines to make size columns readable.

03Risk

RiskLow risk
RequirementsGNU coreutils (preinstalled on Linux)
!Warning: SI (powers of 1000) and IEC (powers of 1024) differ; pick the one that matches the tool producing your numbers.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • GNU coreutils: numfmt
    GNU · vendor-doc · 2026-09-20
    Evidence: Documents numfmt, which reformats numbers to or from human-readable units.
  • Debian package: coreutils
    Debian · vendor-doc · 2026-09-20
    Evidence: Debian packages the GNU coreutils suite, which provides this command.

Last verified: 2026-09-20 · Category: Developer

06Related solutions