CSS Media Query Builder
Build CSS media queries visually. Choose conditions, combine them with AND/OR operators, and get production-ready @media rules. Use preset breakpoints for common devices or craft custom queries. Everything runs in your browser.
How to Use This Tool
Click + Add Condition to build your media query piece by piece. Choose from screen width, height, orientation, color scheme, reduced motion, resolution, aspect ratio, or write a custom feature. Combine multiple conditions with AND or OR operators by clicking the colored badge between conditions.
Features
- 8 query types: width, height, orientation, color-scheme, reduced-motion, resolution, aspect-ratio, and custom
- Support for min/max range selectors with px, em, and rem units
- AND/OR combinators — click the operator badge to toggle
- 8 preset breakpoints: Mobile, Tablet, Desktop, Large, Print, Dark Mode, Landscape, Retina
- Live preview that shows whether the query matches your current viewport
- Syntax-highlighted CSS output with one-click copy
- Keyboard shortcuts: Ctrl+Enter to generate, Ctrl+Shift+C to copy, Ctrl+L to clear
- 100% client-side — nothing is sent to any server
Mobile-First vs Desktop-First
In a mobile-first approach, you write base styles for small screens and use min-width media queries to add styles for larger screens. In a desktop-first approach, you write base styles for large screens and use max-width queries to override styles for smaller screens. Mobile-first is generally recommended because it leads to simpler CSS and better performance on mobile devices.
Modern Media Features
CSS media queries now support user preferences beyond screen size. Use prefers-color-scheme to detect dark or light mode, prefers-reduced-motion to respect users who have enabled reduced motion, and min-resolution: 2dppx to target high-DPI (Retina) displays. These features make your sites more accessible and user-friendly.