pretty-bytes is a JavaScript utility for converting raw byte counts into compact, human-readable size strings. It uses decimal SI units by default, turning values such as 1337 bytes into 1.34 kB. The library can display bits instead of bytes and can switch to binary prefixes such as KiB when appropriate. Signed output is available for showing positive or negative size differences. Formatting can be localized, and developers can control fractional digits, spacing, and non-breaking spaces. Fixed-width output can align values neatly in tables, status displays, and progress interfaces. The function accepts both regular numbers and BigInt values, making it suitable for a wide range of file-size and data-rate displays.

Features

  • Human-readable byte formatting
  • Bit and byte output modes
  • Decimal and binary unit prefixes
  • Localized number formatting
  • Configurable precision and spacing
  • Fixed-width aligned output

Project Samples

Project Activity

See All Activity >

Categories

Calculators

License

MIT License

Follow pretty-bytes

pretty-bytes Web Site

Other Useful Business Software
Ship Agents Faster Icon
Ship Agents Faster

Transform your applications and workflows into powerful agentic systems at global scale.

Gemini Enterprise Agent Platform lets you rapidly build, scale, govern and optimize production-ready agents grounded in your organization's data. The platform enables developers to build custom or pre-built agents for virtually any use case. New customers get $300 in free credits.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of pretty-bytes!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Calculators

Registered

2026-09-09