{"id":66957,"date":"2026-10-13T10:40:45","date_gmt":"2026-10-13T07:40:45","guid":{"rendered":"https:\/\/wpcalc.com\/en\/?p=66957"},"modified":"2026-10-13T10:40:45","modified_gmt":"2026-10-13T07:40:45","slug":"diffraction-grating-calculator","status":"publish","type":"post","link":"https:\/\/wpcalc.com\/en\/physics\/diffraction-grating-calculator\/","title":{"rendered":"Diffraction Grating Calculator"},"content":{"rendered":"<section class=\"not-prose calculator-box\" aria-labelledby=\"calculator-title\"><div class=\"flex items-baseline sm:items-center justify-between gap-2 sm:gap-3\"><div class=\"flex flex-col sm:flex-row sm:items-center gap-2\"><span class=\"icon icon-calculator text-primary-700! text-base! dark:text-primary-300!\" aria-hidden=\"true\"><\/span><h2 id=\"calculator-title\" class=\"text-lg font-display font-bold\">Find the Diffraction Angle of a Spectral Line<\/h2><\/div><div class=\"calcdash-favorite group\">\n  <button type=\"button\" class=\"favorite\" id=\"favorite\" data-favorite-id=\"66957\" data-favorite-title=\"Diffraction Grating\" data-favorite-url=\"https:\/\/wpcalc.com\/en\/physics\/diffraction-grating-calculator\/\" data-favorite-excerpt=\"Calculate the diffraction angle of a spectral line from its wavelength, grating line density and diffraction order. Enter the values and the calculator solves the grating equation and lists all observable orders.\" aria-label=\"Add to Favorites\" data-favorite-icon=\"icon icon-spectrum\">\n    <span class=\"icon icon-shape-star-empty\" aria-hidden=\"true\"><\/span>\n  <\/button>\n  <div class=\"calcdash-favorite__tip\" aria-hidden=\"true\">\n   <span class=\"favorite-tooltip\" id=\"favorite-tooltip\"><\/span>\n  <\/div>\n  <span class=\"sr-only\" role=\"status\" id=\"favorite-status\"><\/span>\n<\/div><\/div><form action=\"https:\/\/wpcalc.com\/en\/physics\/diffraction-grating-calculator\/\" method=\"POST\" class=\"calculator\" id=\"calculator-66957\" data-post=\"66957\"><fieldset class=\"fieldset-input is-1\"><legend class=\"sr-only\">Input Fields<\/legend><div class=\"field has-term\" id=\"input-1\"><label for=\"field-1\">Wavelength (\u03bb)<\/label><div class=\"term\">\u03bb<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><div class=\"field-group\"><input type=\"text\" name=\"wavelength_\" id=\"field-1\" aria-describedby=\"calc-info-1\" data-number inputmode=\"decimal\" autocomplete=\"off\" spellcheck=\"false\" placeholder=\"e.g. 550\" min=\"0\" value=\"550\"\/><div class=\"grid grid-cols-1\"><select id=\"field-2\" name=\"unit\" aria-label=\"Unit\"><option value=\"nm\" selected>nm<\/option><option value=\"um\">\u00b5m<\/option><option value=\"a\">\u00c5<\/option><option value=\"mm\">mm<\/option><\/select><svg class=\"pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end text-gray-500 sm:size-4\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\">\n              <path fill-rule=\"evenodd\" d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\" clip-rule=\"evenodd\" \/>\n            <\/svg><\/div><\/div><small id=\"calc-info-1\">Wavelength of the light. Visible light spans roughly 380\u2013750 nm.<\/small><\/div><div class=\"field has-term\" id=\"input-2\"><label for=\"field-3\">Grating line density (N)<\/label><div class=\"term\">N<\/div>  <div class=\"absolute bottom-0 left-16 top-8 w-2 h-0.5 bg-blue-500\"><\/div><div class=\"field-group\"><input type=\"text\" name=\"grating_line_density_n\" id=\"field-3\" aria-describedby=\"calc-info-3\" data-number inputmode=\"decimal\" autocomplete=\"off\" spellcheck=\"false\" placeholder=\"e.g. 600\" min=\"0\" value=\"600\"\/><div class=\"grid grid-cols-1\"><select id=\"field-4\" name=\"unit\" aria-label=\"Unit\"><option value=\"per_mm\" selected>lines\/mm<\/option><option value=\"per_cm\">lines\/cm<\/option><option value=\"per_in\">lines\/in<\/option><\/select><svg class=\"pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end text-gray-500 sm:size-4\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\">\n              <path fill-rule=\"evenodd\" d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\" clip-rule=\"evenodd\" \/>\n            <\/svg><\/div><\/div><small id=\"calc-info-3\">Number of grooves (slits) per unit length. Typical gratings: 300\u20131200 lines\/mm; a CD \u2248 625 lines\/mm, a DVD \u2248 1350 lines\/mm.<\/small><\/div><div class=\"field\" id=\"input-3\"><label for=\"field-5\">Diffraction order (m)<\/label><div class=\"grid grid-cols-1\"><select id=\"field-5\" name=\"diffraction_order_m\"><option value=\"0 (straight through)\">0 (straight through)<\/option><option value=\"1 (first order)\">1 (first order)<\/option><option value=\"2 (second order)\">2 (second order)<\/option><option value=\"3 (third order)\">3 (third order)<\/option><option value=\"4 (fourth order)\">4 (fourth order)<\/option><option value=\"5 (fifth order)\">5 (fifth order)<\/option><option value=\"6 (sixth order)\">6 (sixth order)<\/option><\/select><svg class=\"pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end text-gray-500 sm:size-4\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\">\n              <path fill-rule=\"evenodd\" d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\" clip-rule=\"evenodd\" \/>\n            <\/svg><\/div><\/div><\/fieldset><div class=\"buttons\"><button type=\"submit\" data-text=\"Re-Calculate\" id=\"calculate-button\" data-post=\"66957\">Calculate<\/button><button type=\"reset\">Reset<\/button><\/div><div class=\"field is-checkbox hidden!\" id=\"field-auto-calc\"><input type=\"checkbox\" id=\"auto-calc\"><label for=\"auto-calc\">Calculate automatically<\/label><small>If enabled, the result will update automatically when you change any value.<\/small><\/div><div class=\"fieldset-result is-hidden\" aria-labelledby=\"result-title\" aria-live=\"polite\" role=\"region\"> <h3 class=\"result-title bg-gradient-to-r from-primary-50 to-gray-50 dark:from-primary-900 dark:to-gray-800\" id=\"result-title\"><span class=\"icon icon-s-pulse\" aria-hidden=\"true\"><\/span> Diffraction Grating Results<\/h3><div class=\"result-box\"><div class=\"field-result is-column\" id=\"output-1\"><span class=\"field-title\"><span>Diffraction angle (\u03b8)<\/span><span class=\"result-term\">\u03b8<\/span><\/span><span class=\"field-value\" id=\"result-1\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><div class=\"field-result is-column\" id=\"output-2\"><span class=\"field-title\"><span>Maximum observable order and all orders<\/span><\/span><span class=\"field-value\" id=\"result-2\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><\/div><div class=\"result-actions\"><button type=\"button\" class=\"copy-link\"><svg viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z\"\/><path d=\"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z\"\/><\/svg><span class=\"copy-link__text\">Copy link to this calculation<\/span><\/button><span class=\"sr-only\" role=\"status\" id=\"copy-link-status\"><\/span><\/div><\/div><a href=\"#respond\" class=\"hidden transition-opacity duration-300 opacity-0 w-50 text-sm justify-center items-center gap-2 px-4 py-2 rounded bg-gray-200 text-gray-700 hover:bg-gray-300\" id=\"leave-comment\"><span class=\"icon icon-comments\" aria-hidden=\"true\"><\/span>Leave a Comment<\/a><\/form><\/section><section id=\"calc-reactions\" class=\"not-prose hidden my-12 bg-gradient-to-r from-primary-50 to-gray-50 border border-indigo-100 rounded-xl px-6 py-4 shadow-sm\" data-post=\"66957\" aria-live=\"polite\" aria-labelledby=\"calc-reactions-title\"><p id=\"calc-reactions-title\" class=\"text-sm text-gray-500 text-center mb-2\">How did this result make you feel?<\/p><div role=\"group\" aria-labelledby=\"calc-reactions-title\" class=\"grid grid-cols-3 sm:flex sm:flex-row sm:justify-around gap-4 sm:items-center sm:flex-wrap\"><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"like\"><span class=\"reaction-count\" data-reaction-count=\"like\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude00 <\/span><span class=\"reaction-description font-medium\">Like <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"helpful\"><span class=\"reaction-count\" data-reaction-count=\"helpful\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\udca1 <\/span><span class=\"reaction-description font-medium\">Helpful <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"confused\"><span class=\"reaction-count\" data-reaction-count=\"confused\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude15 <\/span><span class=\"reaction-description font-medium\">Confused <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"disappointed\"><span class=\"reaction-count\" data-reaction-count=\"disappointed\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude1e <\/span><span class=\"reaction-description font-medium\">Disappointed <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"inaccurate\"><span class=\"reaction-count\" data-reaction-count=\"inaccurate\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\u274c <\/span><span class=\"reaction-description font-medium\">Inaccurate <\/span><\/button><\/div><div id=\"reaction-message\" class=\"hidden mt-8 rounded-md border border-primary-100 bg-white\/50 backdrop-blur-sm px-4 py-2 text-sm text-center shadow-sm\"><\/div><\/section><div class=\"calcdash-ad not-prose calcdash-ad--calc_result calcdash-ad--in-article\"><ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-1721569815777345\" data-ad-slot=\"6317458308\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\"><\/ins><script>(adsbygoogle = window.adsbygoogle || []).push({});<\/script><\/div>\n<style id=\"wpcoderpro-inline-1\">.formula-box {\r\n\tborder-bottom: none !important;\r\n}<\/style><section class=\"formula-box\" aria-labelledby=\"formula-title\">\r\n\t<div id=\"formula-title\" class=\"not-prose font-display mb-4\"><span class=\"icon icon-formula\" aria-hidden=\"true\"><\/span><h2>Diffraction Grating Formula<\/h2><\/div>\r\n\t<figure class=\"not-prose formula\">\r\n\t\t<figcaption class=\"formula-title\">Formula<\/figcaption>\r\n\t\t<div class=\"text-base text-gray-800\" id=\"formula\">\n\\[ d\\,\\sin\\theta = m\\,\\lambda, \\qquad d = \\frac{1}{N} \\]\n<\/div>\r\n\t<\/figure>\r\n\t<\/p>\n<p><strong>Where:<\/strong><\/p>\n<ul>\n<li>\\(d\\) \u2014 groove (slit) spacing of the grating (same length unit as \\(\\lambda\\))<\/li>\n<li>\\(\\theta\\) \u2014 diffraction angle, measured from the grating normal (degrees)<\/li>\n<li>\\(m\\) \u2014 diffraction order, an integer (0, 1, 2, \u2026)<\/li>\n<li>\\(\\lambda\\) \u2014 wavelength of the light<\/li>\n<li>\\(N\\) \u2014 grating line density, i.e. the number of grooves per unit length<\/li>\n<\/ul>\n<p>The grating equation states that constructive interference occurs only at angles where the path difference between light from adjacent grooves equals a whole number of wavelengths. Because the spacing is the reciprocal of the line density, a denser grating (larger \\(N\\)) spreads the spectrum over wider angles.<\/p>\n<p>\r\n<\/section>\n<style id=\"wpcoderpro-inline-459\">.calculation-box {\r\n\tborder-bottom: none !important;\r\n}<\/style><section id=\"calculation\" class=\"calculation-box\" aria-labelledby=\"calculation-title\">\r\n\t<div id=\"calculation-title\" class=\"not-prose font-display\"><span class=\"icon icon-unordered-list\" aria-hidden=\"true\"><\/span><h2>Diffraction Grating \u2013 Calculation Example<\/h2><\/div>\r\n\r\n<\/p>\n<p><strong>Example:<\/strong> green light of wavelength 550 nm hits a grating with 600 lines\/mm. At what angle does the first-order (m = 1) line appear?<\/p>\n<p>\\[ d = \\frac{1}{N} = \\frac{1}{600}\\ \\text{mm} = 1666.67\\ \\text{nm} \\]<\/p>\n<p>\\[ \\sin\\theta = \\frac{m\\lambda}{d} = \\frac{1 \\times 550}{1666.67} = 0.33 \\]<\/p>\n<p>\\[ \\theta = \\arcsin(0.33) = 19.27^{\\circ} \\]<\/p>\n<p><strong>Result:<\/strong> the first-order green line appears at <strong>\u03b8 \u2248 19.27\u00b0<\/strong> from the grating normal (and at \u221219.27\u00b0 on the other side). The same grating shows this wavelength up to order m = 3, since \\(d\/\\lambda = 3.03\\).<\/p>\n<p>\n\r\n<\/section>\n<h2>How to Use the Diffraction Grating Calculator<\/h2>\n<ol>\n<li>Enter the <strong>Wavelength (\u03bb)<\/strong> of the light and choose its unit (nm, \u00b5m, \u00c5 or mm). Visible light is roughly 380\u2013750 nm.<\/li>\n<li>Enter the <strong>Grating line density (N)<\/strong> \u2014 the number of grooves per length \u2014 and select lines\/mm, lines\/cm or lines\/in. Typical lab gratings have 300\u20131200 lines\/mm.<\/li>\n<li>Choose the <strong>Diffraction order (m)<\/strong> from the dropdown. Order 0 is the undeflected beam; higher orders are bent further from the normal.<\/li>\n<li>Read the <strong>Diffraction angle (\u03b8)<\/strong> in degrees from the grating normal, along with the angle from the grating surface and the angle between the two symmetric \u00b1m beams.<\/li>\n<li>Check the <strong>maximum observable order<\/strong> and the table of all orders to see the full angular distribution for this wavelength.<\/li>\n<\/ol>\n<h2>What Is a Diffraction Grating?<\/h2>\n<p>A diffraction grating is an optical component with thousands of equally spaced, parallel grooves (or slits) \u2014 typically only a few micrometres apart. When light passes through or reflects off the grating, each groove acts as a tiny secondary source. The waves from all the grooves interfere, and for most directions they cancel each other out. Constructive interference survives only at specific angles that satisfy \\(d\\sin\\theta = m\\lambda\\), so each wavelength is sent into a small set of well-defined directions.<\/p>\n<p>The result is that white light is split into a rainbow-like spectrum, one per diffraction order. Unlike a prism, which bends red light least, a grating bends longer wavelengths <em>more<\/em>, and the angular positions are predictable directly from the grating equation. This makes gratings the heart of spectrometers, monochromators and wavelength meters: measuring the angle at which a spectral line appears tells you its wavelength with high precision.<\/p>\n<p>The order number \\(m\\) labels the successive interference maxima. Order 0 is the straight-through (or specularly reflected) beam, where all wavelengths overlap and no dispersion occurs. Higher orders deflect light further from the normal and spread the spectrum more widely, improving resolution \u2014 provided the order actually exists: since \\(\\sin\\theta\\) cannot exceed 1, an order is only observable when \\(m\\lambda \\le d\\). The calculator checks this automatically and reports the highest complete order \\(m_{\\max} = \\lfloor d\/\\lambda \\rfloor\\), together with a table of every observable order and its angle.<\/p>\n<p>Everyday examples are surprisingly common: a CD (\u2248 625 lines\/mm) and a DVD (\u2248 1350 lines\/mm) act as reflection gratings, which is why their surfaces shimmer in rainbow colours. Try entering these densities with a wavelength of 550 nm and compare the first-order angles.<\/p>\n<h2>Assumptions, Limitations and Practical Tips<\/h2>\n<ul>\n<li><strong>Normal incidence:<\/strong> the calculator assumes the light hits the grating perpendicular to its surface. At oblique incidence the grating equation gains an extra term and the angles shift.<\/li>\n<li><strong>Ideal grating:<\/strong> groove spacing is treated as perfectly uniform and the angle is measured from the grating normal, as for a transmission grating (for reflection gratings the same geometry applies on the reflected side).<\/li>\n<li><strong>Maximum order:<\/strong> if the requested order requires \\(\\sin\\theta &gt; 1\\), it simply does not exist. The error message tells you the highest order available for your wavelength and line density.<\/li>\n<li><strong>Overlapping orders:<\/strong> with broadband light, order m + 1 of a short wavelength can land at the same angle as order m of a longer wavelength (\\(m\\lambda\\) is the same). Spectrometers use filters to remove the unwanted order.<\/li>\n<li><strong>Units matter:<\/strong> make sure the wavelength and the groove spacing are consistent \u2014 the calculator handles the conversions for you, but only a wavelength <em>smaller<\/em> than the groove spacing produces any diffracted orders.<\/li>\n<li><strong>Brightness:<\/strong> real gratings are often <em>blazed<\/em> to concentrate most energy into one chosen order; the equation gives the angles, not how bright each line is.<\/li>\n<\/ul>\n<p>If you are working with the colour of thermal radiation instead of a monochromatic source, the <a href=\"https:\/\/wpcalc.com\/en\/physics\/wiens-displacement-law-calculator\/\">Wien's Displacement Law calculator<\/a> finds the peak wavelength of a hot object. For other angle-based physics problems, such as trajectories, try the <a href=\"https:\/\/wpcalc.com\/en\/physics\/projectile-motion-calculator\/\">projectile motion calculator<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Calculate the diffraction angle of a spectral line from its wavelength, grating line density and diffraction order. Enter the values and the calculator solves the grating equation and lists all observable orders.<\/p>\n","protected":false},"author":3168,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[62],"tags":[87],"class_list":["post-66957","post","type-post","status-publish","format-standard","hentry","category-physics","tag-waves-optics"],"acf":[],"_links":{"self":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/66957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/users\/3168"}],"replies":[{"embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/comments?post=66957"}],"version-history":[{"count":1,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/66957\/revisions"}],"predecessor-version":[{"id":66958,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/66957\/revisions\/66958"}],"wp:attachment":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/media?parent=66957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/categories?post=66957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/tags?post=66957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}