CSS media query generator
Generate mobile-first or desktop-first CSS media query blocks from Bootstrap, Tailwind or custom breakpoints.
CSS media query generator
Pick a breakpoint scale and this tool writes the matching @media blocks for you, ready to paste into a stylesheet. Choose the Bootstrap or Tailwind presets to reuse the breakpoints those frameworks ship with, or switch to Custom and type your own widths as a comma- or line-separated list — bare numbers like "480, 768, 1024" are auto-named, or pair each one with a label such as "tablet:768".
Mobile-first output cascades upward with min-width only, the pattern most component CSS is written in today; desktop-first cascades downward with max-width only, largest breakpoint first. Turn on range syntax to bound every breakpoint on both sides instead — each block then applies to that tier alone, with the top tier left open above. Widths print in px, em or rem, assuming the common 16px root font size for the conversion. Four extra toggles append standalone queries for orientation, hover-capable pointers, prefers-color-scheme and prefers-reduced-motion, useful when a page needs those checks alongside its layout breakpoints. Switch the output format to SCSS and every block becomes a named @mixin with @content instead, so your Sass build can @include it wherever the rule is needed.
A breakpoint list that resolves to nothing usable — empty, or every entry non-numeric — is reported clearly rather than producing broken CSS; duplicate widths collapse to one block, keeping their first name. Very long custom lists are capped so pasting a huge or malformed value never freezes the tab.
Everything runs locally in your browser — nothing you type is uploaded anywhere. Copy the result, download it as a .txt file, or send it straight to another tool's input to keep working on it.