{"product_id":"fifo-for-inventories","title":"FIFO Calculator for Inventory","description":"\u003cstyle\u003e\n.fifo-calculator {\n  --ink: #0f172a;\n  --muted: #475569;\n  --border: #e2e8f0;\n  --surface: #ffffff;\n  --tint: #f8fafc;\n  --primary: #1d4ed8;\n  --accent: #c2410c;\n  --accent-hover: #9a3412;\n  --chart-1: #1e40af;\n  --chart-2: #0d9488;\n  --chart-3: #7c3aed;\n  --chart-4: #be185d;\n  --chart-5: #334155;\n  color: var(--ink);\n  font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;\n  font-size: 15px;\n  line-height: 1.55;\n  width: 100%;\n  max-width: 1200px;\n  margin: 0 auto;\n  container-type: inline-size;\n}\n.fifo-calculator,\n.fifo-calculator *,\n.fifo-calculator *::before,\n.fifo-calculator *::after { box-sizing: border-box; }\n.fifo-calculator .fifo-shell { min-width: 0; display: grid; gap: 24px; }\n.fifo-calculator .fifo-header { min-width: 0; display: grid; gap: 12px; padding: 24px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(15,23,42,.06); }\n.fifo-calculator .fifo-header h2 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }\n.fifo-calculator .fifo-header p { margin: 0; color: var(--muted); max-width: 780px; }\n.fifo-calculator .fifo-pills { min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }\n.fifo-calculator .fifo-pill { min-width: 0; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--tint); color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }\n.fifo-calculator .fifo-pill strong { color: var(--ink); font-weight: 700; }\n.fifo-calculator .fifo-toolbar { min-width: 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }\n.fifo-calculator .fifo-button { min-width: 0; min-height: 46px; border: 1px solid var(--border); border-radius: 6px; padding: 11px 18px; font: inherit; font-weight: 650; cursor: pointer; background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; white-space: nowrap; box-shadow: 0 1px 2px rgba(15,23,42,.06); }\n.fifo-calculator .fifo-button:hover { box-shadow: 0 2px 5px rgba(15,23,42,.11); border-color: #cbd5e1; }\n.fifo-calculator .fifo-button:focus-visible,\n.fifo-calculator input:focus-visible,\n.fifo-calculator select:focus-visible,\n.fifo-calculator summary:focus-visible { outline: 3px solid rgba(29,78,216,.35); outline-offset: 2px; }\n.fifo-calculator .fifo-download { background: var(--accent); border-color: var(--accent); color: #fff; }\n.fifo-calculator .fifo-download:hover { background: var(--accent-hover); border-color: var(--accent-hover); }\n.fifo-calculator .fifo-button svg { width: 18px; height: 18px; flex: 0 0 auto; }\n.fifo-calculator .fifo-workspace { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }\n.fifo-calculator .fifo-panel { min-width: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(15,23,42,.06); }\n.fifo-calculator .fifo-panel-head { min-width: 0; padding: 16px 20px; border-bottom: 1px solid var(--border); display: grid; gap: 4px; }\n.fifo-calculator .fifo-panel-head h3 { margin: 0; font-size: 18px; line-height: 1.35; font-weight: 650; }\n.fifo-calculator .fifo-panel-head p { margin: 0; color: var(--muted); font-size: 13px; }\n.fifo-calculator .fifo-panel-body { min-width: 0; padding: 20px; display: grid; gap: 20px; }\n.fifo-calculator .fifo-section-title { margin: 0; font-size: 15px; font-weight: 700; }\n.fifo-calculator .fifo-batch-list { min-width: 0; display: grid; gap: 12px; }\n.fifo-calculator .fifo-batch-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--tint); }\n.fifo-calculator .fifo-batch-label { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n.fifo-calculator .fifo-batch-label strong { font-size: 14px; }\n.fifo-calculator .fifo-remove { min-width: 40px; min-height: 40px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; font-weight: 650; }\n.fifo-calculator .fifo-remove:hover { color: #991b1b; border-color: #fecaca; }\n.fifo-calculator .fifo-field-grid { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }\n.fifo-calculator .fifo-field { min-width: 0; display: grid; grid-template-rows: auto auto minmax(20px, auto); gap: 6px; align-content: start; }\n.fifo-calculator .fifo-field label { font-size: 14px; line-height: 1.35; font-weight: 600; color: var(--ink); }\n.fifo-calculator .fifo-field input,\n.fifo-calculator .fifo-field select { min-width: 0; width: 100%; height: 44px; border: 1px solid #cbd5e1; border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; padding: 9px 11px; font-variant-numeric: tabular-nums; }\n.fifo-calculator .fifo-field input[aria-invalid=\"true\"] { border-color: #b91c1c; background: #fff7f7; }\n.fifo-calculator .fifo-helper { min-width: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }\n.fifo-calculator .fifo-error { color: #991b1b; font-size: 13px; font-weight: 600; min-height: 19px; }\n.fifo-calculator .fifo-add { justify-self: start; min-height: 42px; padding-block: 9px; }\n.fifo-calculator .fifo-results { min-width: 0; display: grid; gap: 16px; }\n.fifo-calculator .fifo-primary-result { min-width: 0; padding: 20px; border: 1px solid #bfdbfe; border-radius: 8px; background: #eff6ff; display: grid; gap: 8px; }\n.fifo-calculator .fifo-primary-result span { color: var(--muted); font-size: 13px; font-weight: 600; }\n.fifo-calculator .fifo-primary-result strong { font-size: 30px; line-height: 1.1; font-weight: 700; color: #1e3a8a; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }\n.fifo-calculator .fifo-primary-result p { margin: 0; color: var(--muted); font-size: 13px; }\n.fifo-calculator .fifo-metric-grid { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }\n.fifo-calculator .fifo-metric { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); display: grid; gap: 5px; align-content: start; }\n.fifo-calculator .fifo-metric span { color: var(--muted); font-size: 13px; font-weight: 600; }\n.fifo-calculator .fifo-metric strong { font-size: 20px; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }\n.fifo-calculator .fifo-metric small { color: var(--muted); font-size: 13px; line-height: 1.4; }\n.fifo-calculator .fifo-status { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--tint); color: var(--muted); font-size: 13px; }\n.fifo-calculator .fifo-status[data-state=\"warning\"] { border-color: #fed7aa; background: #fff7ed; color: #9a3412; }\n.fifo-calculator .fifo-breakdown { min-width: 0; }\n.fifo-calculator .fifo-chart-card { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(15,23,42,.06); display: grid; gap: 16px; }\n.fifo-calculator .fifo-chart-card.fifo-safe-stack { grid-template-columns: minmax(0, 1fr); row-gap: 20px; height: auto; }\n.fifo-calculator .fifo-chart-head { min-width: 0; display: grid; gap: 4px; }\n.fifo-calculator .fifo-chart-head h3 { margin: 0; font-size: 18px; line-height: 1.35; font-weight: 650; }\n.fifo-calculator .fifo-chart-head p { margin: 0; color: var(--muted); font-size: 13px; }\n.fifo-calculator .fifo-chart-cluster { min-width: 0; width: 100%; max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: center; justify-content: center; }\n.fifo-calculator .fifo-chart-visual { min-width: 0; width: min(100%, 320px); aspect-ratio: 1; margin: 0 auto; display: grid; place-items: center; }\n.fifo-calculator .fifo-chart-visual svg { display: block; width: 100%; height: 100%; overflow: visible; }\n.fifo-calculator .fifo-chart-legend { min-width: 0; display: grid; gap: 10px; justify-content: center; }\n.fifo-calculator .fifo-legend-row { min-width: 0; display: grid; grid-template-columns: 14px minmax(90px, max-content) max-content max-content; gap: 8px 12px; align-items: center; justify-content: start; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }\n.fifo-calculator .fifo-swatch { width: 12px; height: 12px; border-radius: 3px; }\n.fifo-calculator .fifo-legend-name { min-width: 0; color: var(--ink); }\n.fifo-calculator .fifo-legend-value,\n.fifo-calculator .fifo-legend-percent { color: var(--muted); white-space: nowrap; }\n.fifo-calculator .fifo-chart-summary { min-width: 0; width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }\n.fifo-calculator .fifo-chart-summary th,\n.fifo-calculator .fifo-chart-summary td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; }\n.fifo-calculator .fifo-chart-summary th { color: var(--muted); font-weight: 650; }\n.fifo-calculator .fifo-chart-summary td:nth-child(n+2),\n.fifo-calculator .fifo-chart-summary th:nth-child(n+2) { text-align: right; }\n.fifo-calculator .fifo-chart-caption { min-width: 0; margin-top: 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--tint); color: var(--muted); font-size: 13px; }\n.fifo-calculator .fifo-empty { min-width: 0; width: 100%; padding: 16px; border: 1px dashed #cbd5e1; border-radius: 6px; background: var(--tint); color: var(--muted); text-align: center; font-size: 13px; }\n.fifo-calculator .fifo-table-card { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(15,23,42,.06); display: grid; gap: 16px; }\n.fifo-calculator .fifo-table-card.fifo-safe-table-stack { height: auto; row-gap: 20px; }\n.fifo-calculator .fifo-table-head { min-width: 0; display: grid; gap: 4px; }\n.fifo-calculator .fifo-table-head h3 { margin: 0; font-size: 18px; line-height: 1.35; font-weight: 650; }\n.fifo-calculator .fifo-table-head p { margin: 0; color: var(--muted); font-size: 13px; }\n.fifo-calculator .fifo-table-wrap { min-width: 0; width: 100%; overflow-x: auto; overflow-y: visible; border: 1px solid var(--border); border-radius: 6px; }\n.fifo-calculator .fifo-table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }\n.fifo-calculator .fifo-table th,\n.fifo-calculator .fifo-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }\n.fifo-calculator .fifo-table th { background: #0f172a; color: #fff; font-weight: 650; }\n.fifo-calculator .fifo-table td:nth-child(n+2),\n.fifo-calculator .fifo-table th:nth-child(n+2) { text-align: right; }\n.fifo-calculator .fifo-table tbody tr:last-child td { border-bottom: 0; }\n.fifo-calculator .fifo-table tbody tr:hover td { background: #f8fafc; }\n.fifo-calculator .fifo-table-note { min-width: 0; margin-top: 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--tint); color: var(--muted); font-size: 13px; }\n.fifo-calculator .fifo-education { min-width: 0; padding: 24px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(15,23,42,.06); }\n.fifo-calculator .fifo-education h2 { margin: 28px 0 10px; font-size: 21px; line-height: 1.3; font-weight: 700; }\n.fifo-calculator .fifo-education h2:first-child { margin-top: 0; }\n.fifo-calculator .fifo-education h3 { margin: 20px 0 8px; font-size: 17px; line-height: 1.35; font-weight: 650; }\n.fifo-calculator .fifo-education p { margin: 0 0 12px; color: #334155; }\n.fifo-calculator .fifo-education ul { margin: 0 0 14px; padding-left: 22px; color: #334155; }\n.fifo-calculator .fifo-education li { margin: 5px 0; }\n.fifo-calculator .fifo-education a { color: var(--primary); text-underline-offset: 2px; }\n.fifo-calculator .fifo-education a:hover { color: #1e40af; }\n.fifo-calculator .fifo-formula { min-width: 0; padding: 12px 14px; border-left: 4px solid var(--primary); border-radius: 0 6px 6px 0; background: #eff6ff; font-weight: 650; font-variant-numeric: tabular-nums; }\n.fifo-calculator [hidden] { display: none !important; }\n@container (min-width: 520px) {\n  .fifo-calculator .fifo-batch-row { grid-template-columns: minmax(0, 1fr); }\n  .fifo-calculator .fifo-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n}\n@container (min-width: 640px) {\n  .fifo-calculator .fifo-chart-cluster { grid-template-columns: minmax(260px, 320px) max-content; gap: 24px; }\n  .fifo-calculator .fifo-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }\n}\n@container (min-width: 900px) {\n  .fifo-calculator .fifo-workspace { grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr); }\n}\n@container (max-width: 420px) {\n  .fifo-calculator .fifo-header,\n  .fifo-calculator .fifo-panel-body,\n  .fifo-calculator .fifo-chart-card,\n  .fifo-calculator .fifo-table-card,\n  .fifo-calculator .fifo-education { padding: 16px; }\n  .fifo-calculator .fifo-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); }\n  .fifo-calculator .fifo-button { width: 100%; }\n  .fifo-calculator .fifo-metric-grid { grid-template-columns: minmax(0, 1fr); }\n  .fifo-calculator .fifo-legend-row { grid-template-columns: 14px minmax(0, 1fr) max-content; }\n  .fifo-calculator .fifo-legend-percent { grid-column: 2 \/ 4; padding-left: 0; }\n  .fifo-calculator .fifo-chart-caption,\n  .fifo-calculator .fifo-table-note { margin-top: 12px; }\n}\n\u003c\/style\u003e\n\u003cdiv class=\"fifo-calculator\" data-calculator-root\u003e\n  \u003cdiv class=\"fifo-shell\"\u003e\n    \u003csection class=\"fifo-header\"\u003e\n      \u003ch2\u003eFIFO Inventory Calculator\u003c\/h2\u003e\n      \u003cp\u003eValue cost of goods sold, ending inventory, revenue, and gross margin by consuming the oldest purchase layers first.\u003c\/p\u003e\n      \u003cdiv class=\"fifo-pills\" aria-label=\"Live calculation summary\"\u003e\n        \u003cspan class=\"fifo-pill\"\u003eUnits available \u003cstrong data-fifo-pill-units\u003e210\u003c\/strong\u003e\u003c\/span\u003e\n        \u003cspan class=\"fifo-pill\"\u003eUnits sold \u003cstrong data-fifo-pill-sold\u003e150\u003c\/strong\u003e\u003c\/span\u003e\n        \u003cspan class=\"fifo-pill\"\u003eCOGS \u003cstrong data-fifo-pill-cogs\u003e$1,750.00\u003c\/strong\u003e\u003c\/span\u003e\n        \u003cspan class=\"fifo-pill\"\u003eEnding inventory \u003cstrong data-fifo-pill-ending\u003e$900.00\u003c\/strong\u003e\u003c\/span\u003e\n      \u003c\/div\u003e\n    \u003c\/section\u003e\n\n    \u003cdiv class=\"fifo-toolbar\" aria-label=\"Calculator actions\"\u003e\n      \u003cbutton class=\"fifo-button fifo-download\" type=\"button\" data-fifo-download\u003e\n        \u003csvg viewbox=\"0 0 24 24\" aria-hidden=\"true\"\u003e\u003cpath fill=\"currentColor\" d=\"M12 3a1 1 0 0 1 1 1v9.59l2.3-2.3a1 1 0 1 1 1.4 1.42l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 1 1 1.4-1.42l2.3 2.3V4a1 1 0 0 1 1-1ZM5 19a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H6a1 1 0 0 1-1-1Z\"\u003e\u003c\/path\u003e\u003c\/svg\u003e\n        Download Excel\n      \u003c\/button\u003e\n      \u003cbutton class=\"fifo-button\" type=\"button\" data-fifo-reset\u003eReset\u003c\/button\u003e\n    \u003c\/div\u003e\n\n    \u003cdiv class=\"fifo-workspace\"\u003e\n      \u003csection class=\"fifo-panel\" aria-labelledby=\"fifo-inputs-title\"\u003e\n        \u003cdiv class=\"fifo-panel-head\"\u003e\n          \u003ch3 id=\"fifo-inputs-title\"\u003eInventory purchases and sale\u003c\/h3\u003e\n          \u003cp\u003eEnter purchase batches from oldest to newest. FIFO assigns the earliest costs to sales first.\u003c\/p\u003e\n        \u003c\/div\u003e\n        \u003cdiv class=\"fifo-panel-body\"\u003e\n          \u003cp class=\"fifo-section-title\"\u003ePurchase layers\u003c\/p\u003e\n          \u003cdiv class=\"fifo-batch-list\" data-fifo-batches\u003e\u003c\/div\u003e\n          \u003cbutton class=\"fifo-button fifo-add\" type=\"button\" data-fifo-add\u003eAdd purchase batch\u003c\/button\u003e\n\n          \u003cdiv class=\"fifo-field-grid\"\u003e\n            \u003cdiv class=\"fifo-field\"\u003e\n              \u003clabel for=\"fifo-units-sold\"\u003eTotal units sold\u003c\/label\u003e\n              \u003cinput id=\"fifo-units-sold\" data-fifo-units-sold inputmode=\"decimal\" autocomplete=\"off\" value=\"150\" aria-describedby=\"fifo-units-sold-help fifo-units-sold-error\"\u003e\n              \u003cdiv class=\"fifo-helper\" id=\"fifo-units-sold-help\"\u003eRequired. The calculator consumes units from the oldest available batch.\u003c\/div\u003e\n              \u003cdiv class=\"fifo-error\" id=\"fifo-units-sold-error\" data-fifo-units-sold-error aria-live=\"polite\"\u003e\u003c\/div\u003e\n            \u003c\/div\u003e\n            \u003cdiv class=\"fifo-field\"\u003e\n              \u003clabel for=\"fifo-selling-price\"\u003eSelling price per unit\u003c\/label\u003e\n              \u003cinput id=\"fifo-selling-price\" data-fifo-selling-price inputmode=\"decimal\" autocomplete=\"off\" value=\"$20.00\" aria-describedby=\"fifo-selling-price-help fifo-selling-price-error\"\u003e\n              \u003cdiv class=\"fifo-helper\" id=\"fifo-selling-price-help\"\u003eOptional for inventory valuation; required for revenue and margin.\u003c\/div\u003e\n              \u003cdiv class=\"fifo-error\" id=\"fifo-selling-price-error\" data-fifo-selling-price-error aria-live=\"polite\"\u003e\u003c\/div\u003e\n            \u003c\/div\u003e\n          \u003c\/div\u003e\n        \u003c\/div\u003e\n      \u003c\/section\u003e\n\n      \u003csection class=\"fifo-panel\" aria-labelledby=\"fifo-results-title\"\u003e\n        \u003cdiv class=\"fifo-panel-head\"\u003e\n          \u003ch3 id=\"fifo-results-title\"\u003eLive FIFO results\u003c\/h3\u003e\n          \u003cp\u003eAll outputs update as you edit the layers or sales assumptions.\u003c\/p\u003e\n        \u003c\/div\u003e\n        \u003cdiv class=\"fifo-panel-body fifo-results\"\u003e\n          \u003cdiv class=\"fifo-primary-result\" aria-live=\"polite\" aria-atomic=\"true\"\u003e\n            \u003cspan\u003eFIFO cost of goods sold\u003c\/span\u003e\n            \u003cstrong data-fifo-primary-cogs\u003e$1,750.00\u003c\/strong\u003e\n            \u003cp data-fifo-primary-note\u003e150 units are assigned to the oldest purchase costs.\u003c\/p\u003e\n          \u003c\/div\u003e\n          \u003cdiv class=\"fifo-metric-grid\"\u003e\n            \u003cdiv class=\"fifo-metric\"\u003e\n\u003cspan\u003eEnding inventory\u003c\/span\u003e\u003cstrong data-fifo-ending\u003e$900.00\u003c\/strong\u003e\u003csmall data-fifo-ending-units\u003e60 units remain\u003c\/small\u003e\n\u003c\/div\u003e\n            \u003cdiv class=\"fifo-metric\"\u003e\n\u003cspan\u003eInitial inventory value\u003c\/span\u003e\u003cstrong data-fifo-initial\u003e$2,650.00\u003c\/strong\u003e\u003csmall data-fifo-total-units\u003e210 units purchased\u003c\/small\u003e\n\u003c\/div\u003e\n            \u003cdiv class=\"fifo-metric\"\u003e\n\u003cspan\u003eRevenue\u003c\/span\u003e\u003cstrong data-fifo-revenue\u003e$3,000.00\u003c\/strong\u003e\u003csmall\u003eUnits sold × selling price\u003c\/small\u003e\n\u003c\/div\u003e\n            \u003cdiv class=\"fifo-metric\"\u003e\n\u003cspan\u003eGross profit\u003c\/span\u003e\u003cstrong data-fifo-profit\u003e$1,250.00\u003c\/strong\u003e\u003csmall\u003eRevenue less FIFO COGS\u003c\/small\u003e\n\u003c\/div\u003e\n            \u003cdiv class=\"fifo-metric\"\u003e\n\u003cspan\u003eGross margin\u003c\/span\u003e\u003cstrong data-fifo-margin\u003e41.67%\u003c\/strong\u003e\u003csmall\u003eGross profit ÷ revenue\u003c\/small\u003e\n\u003c\/div\u003e\n            \u003cdiv class=\"fifo-metric\"\u003e\n\u003cspan\u003eAverage FIFO cost sold\u003c\/span\u003e\u003cstrong data-fifo-average-cost\u003e$11.67\u003c\/strong\u003e\u003csmall\u003eCOGS ÷ units sold\u003c\/small\u003e\n\u003c\/div\u003e\n          \u003c\/div\u003e\n          \u003cdiv class=\"fifo-status\" data-fifo-status data-state=\"ok\"\u003eAll 150 sold units are covered by available inventory.\u003c\/div\u003e\n        \u003c\/div\u003e\n      \u003c\/section\u003e\n    \u003c\/div\u003e\n\n    \u003csection class=\"fifo-breakdown\"\u003e\n      \u003cdiv class=\"fifo-chart-card\" data-fifo-chart-card\u003e\n        \u003cdiv class=\"fifo-chart-head\"\u003e\n          \u003ch3\u003eInventory value allocation\u003c\/h3\u003e\n          \u003cp data-fifo-chart-subtitle\u003eThe original inventory value is split between FIFO COGS and the value still on hand.\u003c\/p\u003e\n        \u003c\/div\u003e\n        \u003cdiv class=\"fifo-chart-cluster\" data-fifo-chart-cluster\u003e\n          \u003cdiv class=\"fifo-chart-visual\" data-fifo-chart-visual aria-hidden=\"true\"\u003e\u003c\/div\u003e\n          \u003cdiv class=\"fifo-chart-legend\" data-fifo-chart-legend\u003e\u003c\/div\u003e\n        \u003c\/div\u003e\n        \u003cdiv class=\"fifo-table-wrap\" data-fifo-chart-summary-wrap\u003e\n          \u003ctable class=\"fifo-chart-summary\" aria-label=\"Inventory value allocation data\"\u003e\n            \u003cthead\u003e\u003ctr\u003e\n\u003cth\u003eCategory\u003c\/th\u003e\n\u003cth\u003eAmount\u003c\/th\u003e\n\u003cth\u003eShare\u003c\/th\u003e\n\u003c\/tr\u003e\u003c\/thead\u003e\n            \u003ctbody data-fifo-chart-summary\u003e\u003c\/tbody\u003e\n          \u003c\/table\u003e\n        \u003c\/div\u003e\n        \u003cdiv class=\"fifo-chart-caption\" data-fifo-chart-caption\u003eFIFO has transferred 66.04% of the original inventory value to cost of goods sold.\u003c\/div\u003e\n        \u003cdiv class=\"fifo-empty\" data-fifo-chart-empty hidden\u003eEnter purchase and sales values above to see the allocation.\u003c\/div\u003e\n      \u003c\/div\u003e\n    \u003c\/section\u003e\n\n    \u003csection class=\"fifo-table-card\" data-fifo-table-card\u003e\n      \u003cdiv class=\"fifo-table-head\"\u003e\n        \u003ch3\u003eFIFO layer consumption\u003c\/h3\u003e\n        \u003cp\u003eEach row shows how much of a purchase batch is assigned to COGS and how much remains in ending inventory.\u003c\/p\u003e\n      \u003c\/div\u003e\n      \u003cdiv class=\"fifo-table-wrap\" data-fifo-table-wrap\u003e\n        \u003ctable class=\"fifo-table\"\u003e\n          \u003cthead\u003e\n            \u003ctr\u003e\n\u003cth\u003eBatch\u003c\/th\u003e\n\u003cth\u003eUnits purchased\u003c\/th\u003e\n\u003cth\u003eUnit cost\u003c\/th\u003e\n\u003cth\u003eLayer value\u003c\/th\u003e\n\u003cth\u003eUnits sold\u003c\/th\u003e\n\u003cth\u003eCOGS used\u003c\/th\u003e\n\u003cth\u003eUnits remaining\u003c\/th\u003e\n\u003cth\u003eEnding value\u003c\/th\u003e\n\u003c\/tr\u003e\n          \u003c\/thead\u003e\n          \u003ctbody data-fifo-layer-body\u003e\u003c\/tbody\u003e\n        \u003c\/table\u003e\n      \u003c\/div\u003e\n      \u003cdiv class=\"fifo-table-note\" data-fifo-table-note\u003eRows are processed from oldest to newest. The COGS used column totals the FIFO cost assigned to this sale.\u003c\/div\u003e\n    \u003c\/section\u003e\n\n    \u003csection class=\"fifo-education\"\u003e\n      \u003ch2\u003eWhat does this FIFO inventory calculator estimate?\u003c\/h2\u003e\n      \u003cp\u003eThis calculator applies the first-in, first-out cost-flow assumption to a sequence of inventory purchases. It estimates the FIFO cost of goods sold (COGS), the value and quantity of ending inventory, sales revenue, gross profit, gross margin, and the average cost assigned to units sold. FIFO assumes the oldest purchase costs leave inventory first, even when the physical flow of goods is not tracked unit by unit.\u003c\/p\u003e\n      \u003cp\u003eThe calculation is useful for planning, management reporting, and checking a layer-based inventory schedule. It is not a substitute for an accounting system, a physical inventory count, or professional advice about the method permitted for a specific tax return or financial-reporting framework.\u003c\/p\u003e\n\n      \u003ch2\u003eHow should each input be used?\u003c\/h2\u003e\n      \u003ch3\u003ePurchase batches\u003c\/h3\u003e\n      \u003cp\u003eEnter batches in chronological order, with the oldest purchase first. Each batch requires a quantity and a unit cost. Quantity is the number of units acquired in that layer. Unit cost is the acquisition or production cost assigned to one unit before it is sold. Both values should be zero or positive. Higher quantities increase available inventory; higher unit costs increase the value of that layer and may raise COGS when the layer is consumed.\u003c\/p\u003e\n      \u003cp\u003eUse the add-batch control when inventory was purchased at more than two prices. A batch can be removed when it is not part of the scenario. Common errors include reversing the chronological order, entering a total layer cost instead of a per-unit cost, mixing currencies, or combining batches that should remain separate because their unit costs differ.\u003c\/p\u003e\n\n      \u003ch3\u003eTotal units sold\u003c\/h3\u003e\n      \u003cp\u003eThis required field is the quantity issued or sold during the period. The calculator starts with the oldest batch and continues into later batches until the entered quantity is covered. If units sold exceed units available, the preview caps the cost assignment at available inventory and displays a warning. That treatment prevents a negative inventory balance, but an accounting record should separately address stockouts, timing differences, returns, or missing purchase layers.\u003c\/p\u003e\n\n      \u003ch3\u003eSelling price per unit\u003c\/h3\u003e\n      \u003cp\u003eThe selling price is optional for COGS and ending-inventory valuation, because those outputs depend on purchase costs rather than sales price. It is required for revenue, gross profit, and gross margin. Enter the average realized selling price per unit for a simple scenario. Discounts, returns, sales taxes, freight billed to customers, and multiple selling prices may require a more detailed revenue schedule.\u003c\/p\u003e\n\n      \u003ch2\u003eHow are FIFO COGS and ending inventory calculated?\u003c\/h2\u003e\n      \u003cp class=\"fifo-formula\"\u003eLayer value = units purchased × unit cost\u003cbr\u003eFIFO COGS = sum of oldest layer costs consumed\u003cbr\u003eEnding inventory = total layer value − FIFO COGS\u003c\/p\u003e\n      \u003cp\u003eSuppose 100 units are purchased at $10 and 110 more units are purchased later at $15. Selling 150 units consumes all 100 units from the first layer and 50 units from the second layer. FIFO COGS is therefore $1,000 plus $750, or $1,750. The remaining 60 units belong to the newer $15 layer, so ending inventory is $900.\u003c\/p\u003e\n      \u003cp\u003eThe initial inventory value should always equal FIFO COGS plus ending inventory. The layer table makes this cross-check visible. For every batch, units sold plus units remaining should equal units purchased, and COGS used plus ending value should equal the layer value.\u003c\/p\u003e\n\n      \u003ch2\u003eHow should the results be interpreted?\u003c\/h2\u003e\n      \u003cp\u003e\u003cstrong\u003eFIFO COGS\u003c\/strong\u003e is the cost attached to the units sold. A higher value reduces gross profit when revenue is unchanged. \u003cstrong\u003eEnding inventory\u003c\/strong\u003e is the cost assigned to unsold units and remains on the balance sheet until those units are sold or otherwise written down. \u003cstrong\u003eInitial inventory value\u003c\/strong\u003e is the value of all entered purchase layers before the modeled sale.\u003c\/p\u003e\n      \u003cp\u003e\u003cstrong\u003eRevenue\u003c\/strong\u003e equals units sold multiplied by selling price. \u003cstrong\u003eGross profit\u003c\/strong\u003e equals revenue minus FIFO COGS; a negative value means the modeled sales price does not cover the FIFO cost assigned to the sale. \u003cstrong\u003eGross margin\u003c\/strong\u003e expresses gross profit as a percentage of revenue. A zero revenue produces a neutral 0% margin rather than a division error. \u003cstrong\u003eAverage FIFO cost sold\u003c\/strong\u003e is COGS divided by units sold and can help compare cost trends with pricing.\u003c\/p\u003e\n      \u003cp\u003eThe allocation chart uses the same values as the results and table. Its COGS segment shows the share of original inventory cost transferred to expense, while the ending-inventory segment shows the share still capitalized in stock. After a reset or an all-zero scenario, the chart is replaced by a compact empty state rather than displaying a misleading ring.\u003c\/p\u003e\n\n      \u003ch2\u003eWhy can FIFO change margins and financial ratios?\u003c\/h2\u003e\n      \u003cp\u003eWhen purchase prices rise, FIFO generally assigns older, lower costs to COGS first and leaves newer, higher costs in ending inventory. Compared with a method that uses more recent costs first, that pattern can produce lower COGS, higher gross profit, and a higher ending-inventory balance. Falling prices can reverse the direction. The effect is mechanical: it comes from the order in which cost layers are consumed.\u003c\/p\u003e\n      \u003cp\u003eBecause inventory and COGS feed multiple statements, the choice of method can affect inventory turnover, current assets, gross margin, and other ratios. For U.S. federal tax context, review the \u003ca href=\"https:\/\/www.irs.gov\/publications\/p538\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eIRS guidance on accounting periods and methods\u003c\/a\u003e. For international financial reporting, consult \u003ca href=\"https:\/\/www.ifrs.org\/issued-standards\/list-of-standards\/ias-2-inventories\/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eIAS 2 Inventories\u003c\/a\u003e. U.S. public-company filings and accounting disclosures can also be researched through the \u003ca href=\"https:\/\/www.sec.gov\/edgar\/search\/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eSEC EDGAR database\u003c\/a\u003e.\u003c\/p\u003e\n\n      \u003ch2\u003eWhat are the main benefits and common mistakes?\u003c\/h2\u003e\n      \u003cp\u003eFIFO is easy to follow, often resembles the physical movement of perishable or dated products, and leaves recent costs in ending inventory. The tradeoff is that in a period of rising costs, current revenue may be matched with older costs, so reported margin may not reflect the replacement cost of inventory. Management may therefore review both accounting margin and current purchasing economics.\u003c\/p\u003e\n      \u003cul\u003e\n        \u003cli\u003eKeep purchase layers in true chronological order.\u003c\/li\u003e\n        \u003cli\u003eUse consistent units and currency across every batch.\u003c\/li\u003e\n        \u003cli\u003eDo not enter total purchase value in the unit-cost field.\u003c\/li\u003e\n        \u003cli\u003eInvestigate sales quantities that exceed recorded inventory.\u003c\/li\u003e\n        \u003cli\u003eReconcile the ending quantity to a physical count and the ending value to the general ledger.\u003c\/li\u003e\n        \u003cli\u003eExport the current scenario to Excel when a reviewable audit trail or layer schedule is needed.\u003c\/li\u003e\n      \u003c\/ul\u003e\n    \u003c\/section\u003e\n  \u003c\/div\u003e\n\u003c\/div\u003e","brand":"FinancialModelsLab","offers":[{"title":"Default Title","offer_id":49909482062067,"sku":"fifo-for-inventories","price":0.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0522\/6191\/2762\/files\/fifo-for-inventories.webp?v=1783935403","url":"https:\/\/financialmodelslab.com\/products\/fifo-for-inventories","provider":"Financial Models Lab","version":"1.0","type":"link"}