CSS Unit Converter(px・rem・em・pt変換)
px・rem・em・ptを基準フォントサイズ設定付きで相互変換します。一覧変換表つき。
デフォルト16px。rem/emの計算に使用します。
一覧変換表(基準 16px)
| px | rem / em | pt |
|---|---|---|
| 8px | 0.5 | 6pt |
| 10px | 0.625 | 7.5pt |
| 12px | 0.75 | 9pt |
| 14px | 0.875 | 10.5pt |
| 16px | 1 | 12pt |
| 18px | 1.125 | 13.5pt |
| 20px | 1.25 | 15pt |
| 24px | 1.5 | 18pt |
| 28px | 1.75 | 21pt |
| 32px | 2 | 24pt |
| 36px | 2.25 | 27pt |
| 40px | 2.5 | 30pt |
| 48px | 3 | 36pt |
| 56px | 3.5 | 42pt |
| 64px | 4 | 48pt |
| 72px | 4.5 | 54pt |
| 96px | 6 | 72pt |
How to Use the CSS Unit Converter
This free online CSS unit converter converts between pixels (px), root em (rem), em, and points (pt) instantly in your browser. Set your root font-size (16px by default, which matches the browser default), enter a value with its unit, and see the equivalent value in all four units at once. A reference table below shows common sizes at a glance.
rem vs. em: What Is the Difference?
rem(root em) is always relative to the font-size of the document's root element (html), so its value stays consistent no matter how deeply an element is nested. em is relative to the font-size of the element it is applied to (or its parent, depending on the property), which means the same 1.5em can resolve to different pixel values in different parts of a page if nested elements change font-size along the way. Because this tool only accepts a single base font-size, it calculates em the same way as rem — this is accurate whenever the element in question has not had its own font-size changed by an ancestor, but you should verify against your actual CSS cascade for deeply nested components.
px to pt Conversion
The CSS specification defines a reference pixel at 96 pixels per inch, and a point is defined as 1/72 of an inch. That gives the fixed ratio 1px = 0.75pt (equivalently 1pt ≈ 1.333px), which this tool uses for px ⇄ pt conversion. This is useful when matching CSS sizes against print stylesheets or design specs that use points (common in PDF export and desktop publishing tools).
Why Use rem Instead of px?
Pixel values do not scale when a user increases their browser's default font size for accessibility, but rem and em values do. Using rem for font-size, spacing, and layout measurements is a widely recommended accessibility practice, since it respects user preferences while still giving designers precise, predictable control relative to a single root value.
CSS単位変換ツールの使い方
基準フォントサイズ(デフォルト16px)を設定し、変換したい値と単位(px/rem/em/pt)を入力すると、 4つの単位すべての換算値が同時に表示されます。下の一覧変換表では、よく使う8px〜96pxのサイズを rem・ptに換算した値をまとめて確認できます。全ての計算はブラウザ内で完結します。
よくある落とし穴と対処 / Common Pitfalls
| 落とし穴 / Pitfall | 問題 / Problem | 対処 / Fix |
|---|---|---|
| emの基準を勘違いする Assuming em always matches rem | emは親要素のfont-size基準。ネストが深いと想定外の値になる em is relative to the parent's font-size, which can differ deep in the DOM | 汎用的なサイズ指定にはrem、コンポーネント内部の相対比率にはemを使う Use rem for global sizing, em for ratios within a single component |
| 62.5%リセットを忘れて計算がずれる Forgetting a 62.5% root font-size reset | html { font-size: 62.5% }(=10px基準)を使うプロジェクトがあるSome projects reset the root to 62.5% (10px) for easy rem math | 本ツールの「基準フォントサイズ」を実際のプロジェクト値(例: 10)に変更する Set the base font-size field to match your project's actual root value |
| ブラウザのユーザー設定を考慮しない Ignoring the user's browser font-size setting | pxで固定した文字サイズは、ユーザーが拡大設定してもズームでしか拡大されない Fixed px text does not respond to accessibility font-size preferences | 本文サイズなどアクセシビリティに関わる箇所はrem/emで指定する Use rem/em for body text and other accessibility-sensitive sizing |
| pt指定はWeb表示ではほぼ使わない pt is rarely appropriate for on-screen CSS | ptは印刷向けの単位で、画面表示では意図しない見た目になりやすい pt is a print-oriented unit and can look inconsistent on screen | 画面用CSSはpx/rem/emを使い、pt換算は印刷スタイルシートやデザインカンプとの照合に限定する Reserve pt conversions for print stylesheets or design handoff, not screen CSS |
コード例 / Code Examples
/* 基準フォントサイズ(root) */
html { font-size: 16px; }
/* 16px相当の指定方法いろいろ */
.a { font-size: 16px; }
.b { font-size: 1rem; } /* 16px ÷ 16px = 1rem */
.c { font-size: 1em; } /* 親のfont-sizeが16pxの場合 */
.d { font-size: 12pt; } /* 12pt × (1 / 0.75) = 16px */変換例 / Before & After
基準16px:
16px = 1rem = 1em = 12pt
24px = 1.5rem = 1.5em = 18pt
14px = 0.875rem = 0.875em = 10.5pt
基準10px(62.5%リセット時):
16px = 1.6rem
24px = 2.4remWhy browser-only?
Unit conversion is pure arithmetic with no need for a server round trip. This tool computes every value locally with plain JavaScript: no network request is made as you type, and it keeps working offline once the page has loaded. Check the DevTools Network tab to confirm nothing is sent anywhere.
単位変換は純粋な計算処理のためサーバー通信が不要です。本ツールは全ての計算をブラウザ内の JavaScriptで完結させており、入力内容が外部に送信されることはありません。
関連ツール / Related Tools
開発をもっと効率的に
PR