Why You Are Here
Most media query tools give you an empty @media block and leave you to fill in the styles yourself. That saves you typing about fifteen characters. This tool works the other way around: you paste the CSS you have already written, choose the breakpoint you want it to apply at, and get the complete wrapped rule back with proper indentation.
That difference matters because writing media queries is rarely about remembering the syntax. It is about three other things that slow developers down.
The first is breakpoint values. You are working in a Bootstrap project and cannot remember whether the large breakpoint is 992px or 1024px. You are on a Tailwind project next week and the numbers are completely different. Every framework picked its own scale, and switching between projects means constantly looking up values you half-remember. Selecting a framework preset removes that lookup entirely.
The second is the mobile-first versus desktop-first decision, and getting the direction right once you have chosen. Mixing min-width and max-width inconsistently across a stylesheet produces overlapping rules that fight each other, and the resulting bugs only appear at specific viewport widths that are easy to miss during testing.
The third is the queries nobody memorises. Retina display targeting, print stylesheets, orientation, and the accessibility preference queries all have syntax that most developers look up every single time because they write them a few times a year at most.
What This Tool Does
| Panel | Function |
| Left panel | Paste the CSS rules you want to apply conditionally. This can be a single rule or a full block of styles. |
| Middle panel | Choose how the query should be built: mobile-first min-width, desktop-first max-width, a specific device range, or a special query such as orientation, retina, or print. Framework presets for Bootstrap, Tailwind CSS, Material Design, and Foundation live here. |
| Right panel | The finished media query appears with your CSS correctly nested and indented, ready to copy. |
Mobile-First vs Desktop-First
This is the single most important decision when writing media queries, and it determines which direction every one of your breakpoints points.
Mobile-first uses min-width
Your base CSS, written outside any media query, applies to the smallest screens. Each breakpoint then adds or overrides styles for that width and everything above it. Styles cascade upward.
/* base: applies to all screens */
.card { padding: 16px; }
/* 768px and wider */
@media (min-width: 768px) {
.card { padding: 32px; }
}
Desktop-first uses max-width
Your base CSS targets desktop, and each breakpoint overrides styles for that width and everything below it. Styles cascade downward.
/* base: applies to all screens */
.card { padding: 32px; }
/* 767px and narrower */
@media (max-width: 767px) {
.card { padding: 16px; }
}
Framework Breakpoint Reference
The four frameworks the tool supports use four different breakpoint scales. This is the table developers look up constantly.
|
Label |
Bootstrap 5 | Tailwind CSS | Material Design | Foundation |
|
Extra small |
0px (no query) |
0px (no query) |
0px |
0px (small) |
|
Small |
576px |
640px |
600px |
640px (medium) |
|
Medium |
768px |
768px |
900px |
1024px (large) |
|
Large |
992px |
1024px |
1200px |
1200px (xlarge) |
|
Extra large |
1200px |
1280px |
1536px |
1440px (xxlarge) |
|
Extra extra large |
1400px |
1536px |
— |
— |
Common Device Width Reference
Useful when you need to target a real device band rather than a framework step.
|
Device Category |
Typical Width Range | Common Breakpoint Used |
|
Small phones |
320px to 374px |
320px |
|
Standard phones |
375px to 413px |
375px |
|
Large phones |
414px to 480px |
414px |
|
Small tablets, portrait |
600px to 767px |
600px |
|
Tablets, portrait |
768px to 833px |
768px |
|
Tablets, landscape |
1024px to 1199px |
1024px |
|
Laptops |
1280px to 1439px |
1280px |
|
Desktops |
1440px to 1919px |
1440px |
|
Large desktops |
1920px and above |
1920px |
Special Query Reference
The queries that are hard to remember because you write them rarely.
| Purpose | Query Syntax |
|
Portrait orientation |
@media (orientation: portrait) |
|
Landscape orientation |
@media (orientation: landscape) |
|
Retina and high-DPI screens |
@media (min-resolution: 2dppx) |
|
Print stylesheet |
@media print |
|
Screen only |
@media screen |
|
Dark mode preference |
@media (prefers-color-scheme: dark) |
|
Reduced motion preference |
@media (prefers-reduced-motion: reduce) |
|
Touch input, no fine pointer |
@media (pointer: coarse) |
|
Mouse or trackpad input |
@media (pointer: fine) |
|
Hover capability present |
@media (hover: hover) |
How to Use This Tool
-
Paste Your CSS
Copy the CSS rules you want to apply conditionally into the left input panel. This can be a single rule or a full block of styles.
-
Choose Your Breakpoint Approach
Select mobile-first for a min-width query, desktop-first for max-width, a specific range to target one device band, or a special query for orientation, retina, or print. Use a framework preset if your project runs on Bootstrap, Tailwind, Material Design, or Foundation.
-
Review the Generated Query
The right panel shows the complete media query with your CSS nested and indented correctly.
-
Copy Into Your Stylesheet
Copy the output and paste it into your CSS file, ideally near the rules it modifies rather than in a separate breakpoints section at the bottom.
Use Cases Reference Table
|
Who Uses It |
What They Generate | Purpose |
|
Front-end developers |
Framework-matched breakpoints |
Consistency with Bootstrap or Tailwind config |
|
WordPress theme developers |
Mobile and tablet overrides |
Responsive theme layouts |
|
Email developers |
Max-width queries |
Mobile email client rendering |
|
Accessibility engineers |
Reduced-motion and dark-mode queries |
Respecting user system preferences |
|
UI developers |
Hover and pointer queries |
Preventing sticky hover on touch devices |
|
Print stylesheet authors |
Print media queries |
Clean printed pages without navigation |
|
Designers learning CSS |
Any breakpoint |
Learning syntax through generated examples |
Common Mistakes to Avoid
If one rule uses max-width: 768px and the next uses min-width: 768px, both fire at exactly 768px and the later rule wins unpredictably. If you instead write max-width: 767px and min-width: 768px, fractional viewport widths on high-DPI screens can land between them and match neither. The standard fix is subtracting a small fraction rather than a whole pixel: pair max-width: 767.98px with min-width: 768px. Bootstrap uses exactly this approach.
Writing a breakpoint at 390px because that is the width of a current iPhone produces a stylesheet that ages badly and breaks on every device you did not think of. Resize your layout in the browser until it stops looking right, and put the breakpoint there. Content-driven breakpoints survive new device releases; device-driven breakpoints do not.
A stylesheet that uses min-width in some places and max-width in others becomes very difficult to reason about, because the direction of the cascade changes depending on which rule you are reading. Rules end up overriding each other in ways that only appear at particular viewport widths. Pick one approach for the project and apply it consistently, with narrow exceptions only where a genuinely bounded range is needed.
Quick Reference
| Item | Value |
|
Mobile-first |
min-width |
|
Desktop-first |
max-width |
|
Tablet breakpoint |
768px |
|
Laptop breakpoint |
1024px |
|
Desktop breakpoint |
1280px |
|
Retina |
min-resolution: 2dppx |
|
|
@media print |
|
Dark mode |
prefers-color-scheme: dark |
|
Framework presets |
Bootstrap, Tailwind, Material, Foundation |
|
Server upload |
No |
