Breakpoint Calculator
Calculate CSS breakpoints for responsive design. Compare breakpoints from popular frameworks like Tailwind, Bootstrap, and more.
Breakpoint Settings
Active Breakpoint at 1024px
lg
Breakpoint Visualization
Media Queries
@media (min-width: 640px) { /* sm */ }
@media (min-width: 768px) { /* md */ }
@media (min-width: 1024px) { /* lg */ }
@media (min-width: 1280px) { /* xl */ }
@media (min-width: 1536px) { /* 2xl */ }CSS Variables
:root {
--breakpoint-sm: 640px;
--breakpoint-md: 768px;
--breakpoint-lg: 1024px;
--breakpoint-xl: 1280px;
--breakpoint-2xl: 1536px;
}What Are CSS Breakpoints?
CSS breakpoints are specific viewport widths at which a website's layout changes to provide the best possible user experience for that screen size. They are the foundation of responsive web design — the technique that makes a single codebase render correctly on everything from a 320px mobile phone to a 2560px ultrawide monitor.
When a browser window reaches a breakpoint width, CSS rules inside the corresponding media query activate, allowing developers to reflow content, resize elements, show or hide UI components, and adjust typography. Without breakpoints, a layout designed for a large desktop would render at full scale on a phone, forcing users to zoom and scroll horizontally just to read a headline.
Modern CSS frameworks like Tailwind CSS, Bootstrap, Foundation, and Material UI each ship with a predefined set of breakpoints tuned to the most common device categories: phones, tablets, laptops, and large desktop monitors. Understanding where these thresholds sit — and how they differ between frameworks — is essential for developers who work across multiple projects or who migrate code between systems.
This breakpoint calculator lets you select a framework, enter any test width in pixels, and instantly see which breakpoint tier is active, the corresponding CSS media query code, and the CSS custom property declarations you can paste directly into your stylesheet. Quick-test buttons for Mobile (375px), Tablet (768px), Laptop (1024px), and Desktop (1920px) let you verify common device widths in seconds.
How the Active Breakpoint Is Detected
The calculator uses a mobile-first, min-width strategy — the same approach used by Tailwind CSS, Bootstrap 5, Foundation, and Material UI. Each breakpoint defines the minimum viewport width at which its styles apply. The currently active breakpoint is the highest-valued breakpoint whose minimum width does not exceed the test width you provide.
Internally the algorithm sorts all breakpoints in descending order by their pixel value, then scans through the sorted list until it finds the first breakpoint whose value is less than or equal to the test width. That is the active tier. All styles defined at that tier — and every lower tier — are simultaneously in effect at the given width.
For example, Tailwind CSS defines sm at 640px, md at 768px, lg at 1024px, xl at 1280px, and 2xl at 1536px. If your test width is 900px, the sorted list is checked in order: 1536 > 900, 1280 > 900, 1024 > 900, and then 768 ≤ 900 — so md is the active breakpoint. Styles applied at the md tier and all tiers below it (sm and unprefixed base styles) are active at 900px.
If no named breakpoint has a value at or below the test width — which happens in Tailwind when the viewport is under 640px — the result is none. This is correct behavior: Tailwind's unprefixed base styles apply at all widths, so "none" simply means no named prefix is currently engaged.
Active Breakpoint Formula
Where:
- activeBreakpoint= The name of the breakpoint tier currently in effect
- bp.value= The minimum-width threshold (px) for a given named breakpoint
- testWidth= The viewport width being tested (px)
Framework Breakpoint Comparison
Different CSS frameworks choose different breakpoint values based on their design philosophy and the device landscape at the time of their creation. The table below compares the four frameworks supported by this calculator side by side, using their pixel values.
| Tier | Tailwind CSS | Bootstrap 5 | Foundation | Material UI |
|---|---|---|---|---|
| XS / Base (0px) | — (implicit) | xs: 0px | small: 0px | xs: 0px |
| Small / SM | sm: 640px | sm: 576px | medium: 640px | sm: 600px |
| Medium / MD | md: 768px | md: 768px | large: 1024px | md: 900px |
| Large / LG | lg: 1024px | lg: 992px | xlarge: 1200px | lg: 1200px |
| Extra Large / XL | xl: 1280px | xl: 1200px | xxlarge: 1440px | xl: 1536px |
| 2XL / XXL | 2xl: 1536px | xxl: 1400px | — | — |
Bootstrap 5 and Material UI both define an explicit xs tier at 0px, meaning every width below the next named tier falls into a named bucket. Tailwind takes the opposite approach: styles written without a prefix apply at all screen sizes, while named prefixes only add rules at and above their threshold. Foundation uses descriptive names (small, medium, large) instead of abbreviations, which can improve readability in larger teams.
Note that Tailwind and Foundation share a 640px small breakpoint, while Bootstrap's sm sits 64px lower at 576px. This matters most when targeting landscape phones: a 600px-wide viewport is "sm" in Bootstrap and Material UI but falls below the first named breakpoint in Tailwind.
Generated Media Queries and CSS Variables
After you select a framework and enter a test width, the calculator outputs two ready-to-use code snippets: a set of CSS media queries and a block of CSS custom properties. Both can be copied to the clipboard in one click.
The media query output follows the standard min-width format used by every major framework. For each breakpoint with a non-zero minimum width, the calculator generates a rule in the form @media (min-width: Npx) { /* name */ }. Zero-based breakpoints are intentionally excluded from the media-query list because @media (min-width: 0px) is always true and adds no useful conditional logic — the styles you want applied universally belong in your base (unprefixed) CSS instead.
The CSS variables block wraps every breakpoint — including zero-based ones — into --breakpoint-[name] custom properties inside a :root selector. These are particularly valuable for JavaScript that needs to read breakpoint thresholds at runtime. You can retrieve a value with getComputedStyle(document.documentElement).getPropertyValue('--breakpoint-lg') and use the result to conditionally render components, trigger animations, or adjust Canvas dimensions — all without duplicating magic numbers in your JavaScript files.
Keeping breakpoint values in CSS custom properties ensures that your JavaScript thresholds stay synchronized with your stylesheet automatically. If you later adjust the lg threshold from 1024px to 1000px, updating the CSS variable is all that's needed — the JavaScript picks it up without a separate code change.
Responsive Design Best Practices
Breakpoints are one of the most misunderstood tools in CSS. A common mistake is designing for specific devices — choosing breakpoints that match the pixel dimensions of popular phone models. Device dimensions change rapidly and screen resolutions vary even within a single product line, so content-first breakpoints produce more durable, future-proof designs.
The preferred workflow is to start with the smallest possible layout (mobile-first), then progressively widen a browser window or the preview pane in your design tool. Add a breakpoint only when the content genuinely starts to look awkward — text lines becoming too long, images becoming too narrow, a grid that could accommodate another column. Each breakpoint should be motivated by the content, not by a device spec sheet.
When using a framework like Tailwind or Bootstrap, try to stay within the predefined tier system wherever possible. Custom breakpoints add complexity and make it harder for new developers joining a project to predict behavior. Reserve custom breakpoints for genuinely exceptional cases, such as a hero banner that needs a mid-tier adjustment not covered by the default scale.
Typography is often the first thing to suffer at untested widths. A comfortable reading line length is 45 to 75 characters per line. If your body text runs 120 characters wide on a large desktop, a breakpoint to cap the content width or switch to a multi-column layout is warranted. Similarly, very short lines on mobile feel cramped — always test at 320px, the smallest viewport still in widespread use among older Android devices.
Always test your breakpoints with real content, not placeholder text. Headings that fit neatly with a short title may overflow catastrophically with a longer one. Tables, code blocks, and data visualizations are notorious for breaking responsive layouts because they have intrinsic minimum widths that resist shrinking. Test every breakpoint boundary — both one pixel below and one pixel at the threshold — to catch the edge cases that cause sudden layout jumps.
When and How to Use Custom Breakpoints
The custom mode in this calculator lets you define your own breakpoint names and pixel values from scratch. This is valuable when you are working outside a standard framework — for instance, building a design system from scratch, adapting a legacy codebase, or tailoring a layout for a specific device fleet such as digital signage or point-of-sale kiosks where viewport widths are fixed and known in advance.
When defining custom breakpoints, start by auditing your analytics data for the most common screen widths among your actual users. Tools like Google Analytics and Plausible report screen resolution distributions for your specific audience, which may differ significantly from global averages. A B2B SaaS product used primarily on corporate desktops has a very different viewport-width distribution than a consumer recipe app visited mostly on phones.
Keep custom breakpoint sets small — three to five tiers is usually sufficient. Each additional breakpoint multiplies the number of layout states you need to test and maintain. Name breakpoints semantically (for example, "compact", "standard", "wide") rather than after devices (for example, "ipad") so names remain meaningful as technology evolves. The custom mode initializes with Tailwind's default breakpoints as a sensible starting point that you can then trim or extend.
Worked Examples
Tailwind CSS at Laptop Width (1024px)
Problem:
A developer building a Tailwind CSS project wants to know which breakpoint is active at exactly 1024px.
Solution Steps:
- 1Select the Tailwind CSS framework. Its named breakpoints are: sm=640px, md=768px, lg=1024px, xl=1280px, 2xl=1536px.
- 2Enter test width = 1024px.
- 3Sort breakpoints descending by value: 2xl(1536), xl(1280), lg(1024), md(768), sm(640).
- 4Scan for the first bp.value ≤ 1024: 2xl=1536 > 1024 (skip), xl=1280 > 1024 (skip), lg=1024 ≤ 1024 — match found.
- 5Active breakpoint = lg. Generated media query: @media (min-width: 1024px) { /* lg */ }
Result:
At 1024px with Tailwind CSS the active breakpoint is lg. All Tailwind utilities using the lg: prefix, md: prefix, sm: prefix, and unprefixed base styles are simultaneously in effect.
Bootstrap 5 on a Large Monitor (1440px)
Problem:
A QA engineer needs to verify which Bootstrap 5 breakpoint is active on a 1440px external monitor.
Solution Steps:
- 1Select Bootstrap 5. Its breakpoints are: xs=0, sm=576, md=768, lg=992, xl=1200, xxl=1400.
- 2Enter test width = 1440px.
- 3Sort breakpoints descending: xxl(1400), xl(1200), lg(992), md(768), sm(576), xs(0).
- 4Scan for the first bp.value ≤ 1440: xxl=1400 ≤ 1440 — match found immediately.
- 5Active breakpoint = xxl. Generated media query: @media (min-width: 1400px) { /* xxl */ }
Result:
At 1440px with Bootstrap 5 the active breakpoint is xxl (minimum 1400px). All Bootstrap column classes, utility classes, and component variants with the xxl- infix apply.
Foundation Framework on a Tablet (900px)
Problem:
A designer wants to know which Foundation breakpoint is active at 900px to understand which grid configuration applies.
Solution Steps:
- 1Select Foundation. Its breakpoints are: small=0, medium=640, large=1024, xlarge=1200, xxlarge=1440.
- 2Enter test width = 900px.
- 3Sort breakpoints descending: xxlarge(1440), xlarge(1200), large(1024), medium(640), small(0).
- 4Scan for the first bp.value ≤ 900: 1440 > 900 (skip), 1200 > 900 (skip), 1024 > 900 (skip), medium=640 ≤ 900 — match found.
- 5Active breakpoint = medium. Generated media query: @media (min-width: 640px) { /* medium */ }
Result:
At 900px with Foundation the active breakpoint is medium (640px through 1023px). Foundation grid classes and visibility utilities targeting the medium breakpoint are active.
Material UI on a Small Phone (375px)
Problem:
A React developer using Material UI wants to confirm what breakpoint a 375px iPhone viewport falls into.
Solution Steps:
- 1Select Material UI. Its breakpoints are: xs=0, sm=600, md=900, lg=1200, xl=1536.
- 2Enter test width = 375px.
- 3Sort breakpoints descending: xl(1536), lg(1200), md(900), sm(600), xs(0).
- 4Scan for the first bp.value ≤ 375: 1536 > 375 (skip), 1200 > 375 (skip), 900 > 375 (skip), 600 > 375 (skip), xs=0 ≤ 375 — match found.
- 5Active breakpoint = xs. xs is a zero-value tier, so it is included in CSS variables but not in the media-query output.
Result:
At 375px with Material UI the active breakpoint is xs (0px through 599px). Material UI components using xs grid sizing and sx prop breakpoint conditions apply at this width.
Tips & Best Practices
- ✓Use the Quick Test buttons (Mobile 375px, Tablet 768px, Laptop 1024px, Desktop 1920px) to check the most common device widths without typing a number.
- ✓Tailwind CSS shows 'none' for widths below 640px — this is correct; base (unprefixed) Tailwind styles are active, meaning no named breakpoint prefix is in effect.
- ✓Click the Copy button next to Media Queries or CSS Variables to paste framework-accurate code directly into your stylesheet or component file.
- ✓Bootstrap 5 added the xxl tier (1400px) compared to Bootstrap 4 — always recheck breakpoint names when upgrading a project.
- ✓Custom mode starts with Tailwind's defaults as a base; adjust the values or add tiers to match your project's design tokens, then copy the generated snippets.
- ✓The breakpoint visualization bar shows your test width as a red marker against all tiers at once, making it easy to see how far you are from the next threshold.
- ✓Store breakpoint values as CSS custom properties in :root so your JavaScript can read them at runtime without duplicating pixel values across files.
- ✓Test layouts at both one pixel below and one pixel at each breakpoint boundary (e.g., 767px and 768px for Tailwind md) to catch sudden layout jumps at the edge.
Frequently Asked Questions
Sources & References
Last updated: 2026-06-05
Help us improve!
How would you rate the Breakpoint Calculator?
Editorial Note
MyCalcBuddy Editorial Team
This page is maintained as an educational calculator reference.
Formula Source: Standard Mathematical References
by Various