Contact

Tools  /  Generators  /  Pagination Generator

Pagination Generator

Build a pagination control — from a total-item count and page size, with a windowed page range (sibling + boundary counts, ellipsis), prev / next, first / last, a jump-to-page box, a results summary, link or button mode, and a theme — with a live preview and HTML + CSS + JS output, a reusable paginate() helper, or a React / Vue / Tailwind component.

What this tool does

It builds the markup, styles and logic for a page navigator and renders it live.

The range algorithm

Given the current page, the total, a sibling count (pages on each side of the current one) and a boundary count (pages pinned at each end), it produces a list like 1 … 4 5 6 7 8 … 20, collapsing gaps to an ellipsis and replacing a one-page gap with the actual number.

Link vs button

Link mode emits <a> tags from an href template (?page={page}) for server-rendered lists. Button mode emits buttons and JS that updates the control and fires a pagechange event.

Extras

First / last jumps, a jump-to-page number box, and a results summary computed from the page size.

Output

HTML + CSS + JS, a standalone paginate() function you can drop into any project, or React / Vue / Tailwind.

Privacy

Everything runs in your browser. Nothing is uploaded.

Frequently asked questions

What do sibling and boundary counts do?
Sibling count is how many pages show on each side of the current page; boundary count is how many are always shown at the very start and end. Siblings 1 / boundaries 1 gives "1 … 4 [5] 6 … 20".
Can I use it with server-side rendering?
Yes — pick link mode and set the href template, e.g. "/blog?page={page}". Each page number becomes an with the real URL and no JavaScript is required.
What is the paginate() helper?
A ~20-line pure function that takes (currentPage, totalPages, siblingCount, boundaryCount) and returns an array of page numbers and "ellipsis" markers. The generated component uses it; you can use it standalone with any UI.
Does it handle the "gap of one" case?
Yes. When an ellipsis would hide exactly one page number, it shows that number instead — no "1 … 3 …" with a single hidden page.
Is anything sent to a server?
No. The control is generated entirely in your browser.
Theme Accent