ข้ามไปยังเนื้อหาหลัก

การแปลงตามขนาดฟอนต์รากพร้อมตารางสเกลทั่วไป

ดูคำตอบอย่างรวดเร็ว

px ↔ rem Converter: Root font-size based conversion with common scale table. rem = px ÷ root font-size (browser default 16px).

px
px
rem
24px = 1.5rem · 1.5rem = 24px
1 rem16 px
24 px1.5 rem
1.5 rem24 px
62.5% trick10px = 1rem

ขั้นตอนการแปลงค่า

  1. 1rem = px ÷ root font-size. 24px ÷ 16 = 1.5000 rem.
  2. 2px = rem × root font-size. 1.5rem × 16 = 24.00 px.
  3. 3html { font-size: 62.5% } ตั้งขนาดฟอนต์รากเป็น 10px ในขณะนี้ 1.6rem=16px การคำนวณในใจไม่มีต้นทุน (แต่จะทับที่การตั้งค่าขนาดฟอนต์ของเบราว์เซอร์ผู้ใช้ ต้องพิจารณา)

เกรเดียนต์ที่ใช้บ่อย (คลิกเพื่อเติม)

pxremวัตถุประสงค์การใช้
12px0.75remCaption text
14px0.875remSmall body
16px1remDefault body (browser base)
18px1.125remLarge body
20px1.25remSmall heading
24px1.5remH3 heading
32px2remH2 heading
48px3remH1 display
rem เคารพการตั้งค่าขนาดฟอนต์ของเบราว์เซอร์ผู้ใช้ (เป็นมิตรกับการเข้าถึง) px ไม่เคารพ ใช้ rem สำหรับขนาดฟอนต์และระยะห่างของเลย์เอาต์ ใช้ px สำหรับเส้นขอบ (เส้นผม 1px) และเงา em สัมพันธ์กับขนาดฟอนต์ขององค์ประกอบแม่ — เมื่อซ้อนกันจะขยาย/หดตัวทีละชั้น ใช้ด้วยความระมัดระวัง

เครื่องมือนี้มีประโยชน์กับคุณไหม?

วิธีใช้งาน

  1. Paste or type content: drop code/text into the px ↔ rem Converter or fill the parameters.
  2. Choose mode/options: switch format, rules or processing as needed.
  3. Live output: results appear instantly — nothing is submitted, data stays in your browser.
  4. One-click copy: copy the output straight into your development environment.

ประเด็นสำคัญ

  • px ↔ rem Converter is a free online developer tool — open and use, no sign-up.
  • All calculations run locally in your browser; your data never leaves the device.
  • Key capability: Root font-size based conversion with common scale table.
  • Results come with formulas and reference tables so you can verify every number.

หลักการและสูตรการคำนวณ

px ↔ rem conversion

rem = px ÷ root font-size (browser default 16px)
em is relative to the parent (compounds); rem is always root-relative
vw = px ÷ viewport width × 100
Trick: set html font-size to 62.5% so 1rem = 10px

Example: 24px at 16px root = 1.5rem; 24px on a 1440px viewport ≈ 1.667vw.

คำถามที่พบบ่อย

How do I use the px ↔ rem Converter?
Open the page and fill in the input fields — results update automatically. Root font-size based conversion with common scale table.
Are the results accurate?
Yes. Standard formulas and conversion factors are used and verified.
Is it free? Do I need to sign up?
Completely free. No registration, login or download required.
Does it work on mobile?
Yes. The responsive design works on phones, tablets and desktops.
Is my data saved?
No. Everything runs locally in your browser.

เครื่องมือที่เกี่ยวข้อง

ดูเครื่องมือทั้งหมด 55 รายการในหมวดหมู่นี้ →

คู่มือที่เกี่ยวข้อง

แหล่งที่มาและการอัปเดต

Based on RFC 4648, ECMA-262 and related specifications. Last updated: 2025-07

อัปเดตล่าสุด:

สูตรและเนื้อหาในหน้านี้ได้รับการตรวจสอบซ้ำโดยทีมงาน YiJianSuan มีไว้สำหรับการเรียนรู้อ้างอิงเท่านั้น สำหรับการใช้งานจริงโปรดปฏิบัติตามข้อมูลอย่างเป็นทางการ

เนื้อหานี้ได้รับการดูแลและตรวจสอบซ้ำเป็นประจำโดยทีมงานแก้ไขของ YiJianSuan ขั้นตอนการอัปเดตและตรวจสอบสามารถดูได้ที่นโยบายการแก้ไขเนื้อหา.

อ้างอิงหน้านี้: YiJianSuan. เครื่องแปลง px ↔ rem[EB/OL]. https://www.yijiansuan.com/th/c/dev/px-rem

ผลลัพธ์ที่ได้จากเครื่องมือนี้มีไว้สำหรับการอ้างอิงเท่านั้น ไม่ถือเป็นคำแนะนำทางวิชาชีพใดๆ โปรดใช้ผลการคำนวณอย่างเป็นทางการเป็นหลัก