CSS & Layout
Media Query Generator
Pick a breakpoint and any device conditions, then copy a ready-to-use
@media block. The live match preview shows whether the query applies
to a simulated device. Everything runs in your browser — nothing is sent to a server.
Build your query
liveAdvanced conditions Contrast and display mode
Generated media query
copy & pasteLive match preview
—Simulated device preferences Defaults to your device
How it works
Each non-empty condition is combined with and to form a complete
@media block. The live match preview compares the query against a simulated
viewport: width and height drive orientation, and the preference conditions
are matched against the simulated device settings (which start from your real device).
Widths in rem or em are converted at 16px per unit for
comparison. Invalid input is reported inline instead of producing broken CSS.