---
title: "PX to REM Converter"
method: POST
path: "/api/v1/tools/px-rem-converter"
tags: ["tools"]
---

# PX to REM Converter

`POST /api/v1/tools/px-rem-converter`

## Request

- Base URL: `https://toolforte.com`
- URL: `https://toolforte.com/api/v1/tools/px-rem-converter`
- Auth: HTTP bearer

Convert a pixel value to rem or a rem value to pixels for a given root font size, 16px unless told otherwise. Returns both numbers and CSS-ready strings.

## Request body

- object
  - `value` integer
  - `direction` string
  - `rootFontSize` integer

## Response `200`

Successful result

- object
  - `ok` boolean
  - `data` object
    - `input` integer
    - `direction` string
    - `rootFontSize` integer
    - `px` integer
    - `rem` number
    - `pxText` string
    - `remText` string

## Other responses

- `400`: Missing or invalid request fields
- `401`: Invalid or missing API key
- `429`: Monthly plan limit reached

---

[API](https://skmtc.dev/toolforte/apis/toolforte-api.md) · [All operations](https://skmtc.dev/toolforte/apis/toolforte-api/llms.txt) · [OpenAPI document](https://skmtc.dev/toolforte/apis/toolforte-api/revisions/4d814d484dfc?raw)
