CSS Media Query Generator
Build a @media query from multiple ANDed conditions (width, height, orientation, colour scheme, reduced motion, hover/pointer capability, aspect ratio) with a live "does your browser match right now?" indicator. Presets, and export to CSS, SCSS or Tailwind.
What this tool does
Builds a @media query from any combination of
conditions ANDed together, wrapping a block of CSS you supply —
with a live indicator that checks, using the browser's own
window.matchMedia(), whether the query actually
matches right now, updating as the window is resized.
Eight condition types
Min/max width, min/max height, orientation, preferred colour scheme (light/dark), preferred reduced motion, hover capability, pointer type (fine/coarse/none), and aspect ratio — the full set used for responsive layout and accessibility-aware media queries, not just the width breakpoints most generators stop at.
Multiple ANDed conditions
Any number of conditions can be combined — a query for "landscape AND under 900px" or "coarse pointer AND no hover" (a reasonable touch-device detector) needs more than one condition at once, and each can be added or removed independently.
A real, live match check
Rather than only generating the query text, the tool actually
evaluates it against the current browser using
matchMedia() and shows a live match/no-match
indicator that updates on window resize — confirming the query
behaves as expected before it ships.
Presets and the CSS to wrap
Eight presets — Mobile Only, Tablet, Desktop Up, Wide Screens, Dark Mode, Landscape Mobile, Reduced Motion, and Touch Devices — cover common breakpoint and capability queries. The CSS block the query wraps is directly editable, so the exported code is a complete, ready-to-use rule.
Getting it out
Export as plain CSS, SCSS, or a Tailwind config note for adding the query as a custom screen, copyable with one click.
Privacy
Everything, including the live match check, runs locally in your browser -- nothing is sent to a server.