Calculates on this device. File exports run online.
Database Size Calculator
Describe a table — its columns, how long its text is, how many values are empty, its indexes and how many rows it has — and see how many bytes each row takes in PostgreSQL, MySQL (InnoDB), SQL Server, SQLite or MongoDB, how many rows fit in a page, and the size of the table and its indexes now and as it grows. Every step of the formula is shown, and every overhead of the engine is listed as an assumption. Add up whole databases, or measure a sample of your data to get real average lengths.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose the button below them.
Your result
How it was worked out
How to use it
- Choose Estimate a table, pick the engine, and list the columns with their types. For text, give the average length in bytes; for decimals, the number of digits. Give the share of empty values where you know it.
- Add the primary key and the other indexes, the rows you have now and the rows you add each month. Press Estimate the size.
- Not sure about lengths? Choose Measure a sample of data, paste a few hundred rows, and use the average bytes it finds.
What is and is not counted
- Counted: the engine’s page size and page headers, row headers, null bitmaps, length bytes, alignment padding, hidden columns, and B-tree index entries and pages, as each engine documents them.
- Not counted: compression, dead rows and bloat after updates and deletes, pages left half full by random inserts, large values stored outside the row (TOAST, off-page, LOB), write-ahead and redo logs, backups and replicas.
- Treat the result as a careful estimate: check it against a real table of a few thousand rows in your own database.