Rows Per Page Calc
Enter total rows and a page size or page count for total pages, the rows on any page and ready SQL; or describe a table row to see how many rows fit in an 8 KB database page and how large the table is.
Rows per page is how many records a table or query shows on each page.
Use the Rows Per Page Calc
Pagination Inputs
Sort column used in the snippets; a unique, indexed column keeps pages stable.
Enter your values and press Calculate
SQL Snippets
Page Explorer
Keyset (seek) pagination — next page
Reads only the rows it returns, so page 10,000 is as fast as page 1. Pass the last sort value of the current page.
Rows per database page (storage)
How many rows fit in one 8 KB SQL Server or PostgreSQL data page, how many pages the table needs and how big it is on disk.
Byte sizes: int 4, bigint 8, date 3 (SQL Server) / 4 (PostgreSQL), datetime2/timestamp 8, decimal(18,2) 9, uniqueidentifier/uuid 16, char(n) n; varchar holds its actual length, nvarchar 2 bytes per character.
Quick answer
Rows per page is how many records a table or query shows on each page. Total pages = total rows ÷ rows per page, rounded up; the last page holds the remainder, and page N starts at OFFSET (N − 1) × rows per page in SQL.
Examples
| Rows per page | Pages for 1,234 rows | Rows on last page |
|---|---|---|
| 10 | 124 | 4 |
| 25 | 50 | 9 |
| 50 | 25 | 34 |
| 100 | 13 | 34 |
Enter your row count for total pages and LIMIT/OFFSET SQL for any page.
Summary
The Rows Per Page Calculator covers both meanings of "rows per page". For pagination, enter the total row count and a page size or page count to get total pages, the last-page row count, the "showing 26–50 of 1,234" range for any page and copy-ready SQL in LIMIT/OFFSET or OFFSET … FETCH form, plus a keyset (seek) query for deep pages. For storage, describe a row (columns, fixed-length bytes, variable-length data) and it applies the Microsoft SQL Server heap formula (8,096 usable bytes, 2-byte slot per row), the PostgreSQL page layout (24-byte page header, 23-byte tuple header, 4-byte line pointer, 8-byte alignment) or an InnoDB approximation to give rows per page, data pages and table size. All computation runs in the browser.
How it works
- Enter the total number of rows in your dataset.
- Choose a calculation mode: fix the page size and calculate page count, or fix the page count and calculate page size.
- Enter your page size or desired page count.
- The tool calculates total pages, rows on the last page, and generates SQL snippets.
- Use the page explorer to get the row range and the exact LIMIT/OFFSET (or OFFSET … FETCH) for any page.
- Copy any SQL snippet to your clipboard with one click.
- For storage sizing, choose the database engine and enter the column count and byte sizes to get rows per data page, page count and table size.
Use cases
- Plan pagination for a large database table before writing queries.
- Calculate the correct LIMIT and OFFSET values for a specific page.
- Estimate how many pages a result set will span for UI design.
- Determine page size for REST API cursor or offset pagination.
- Quickly convert between page count and page size for reporting tools.
- Validate that your pagination logic handles the last (partial) page correctly.
- Generate ready-to-copy SQL snippets for PostgreSQL, MySQL, or SQLite.
- Teach junior developers how LIMIT/OFFSET pagination works.