Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>PRem – px to remNew to Visual Studio Code? Get it now.
PRem – px to rem

PRem – px to rem

Andreas Kolli

|
28 installs
| (0) | Free
Convert pixel values into rem units directly from IntelliSense.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

PRem

PRem is the fastest way to convert pixel values into rem units directly via IntelliSense in VS Code.

Type a number followed by the custom keywords prem or pxrem, then accept the suggestion. If completion is unavailable or disabled, select a value like 16px and run PRem: Convert Selection to rem.

PRem is scoped to style-heavy languages such as CSS, SCSS, Sass, Less, PostCSS, HTML, Vue, Svelte, and Astro.

Examples:

  • 16prem → 1rem
  • 24prem → 1.5rem
  • -8prem → -0.5rem
  • 14.35prem → 0.89688rem

Settings

prem.pixelsPerRem

  • Default: 16
  • Controls how many pixels equal 1rem
  • Can be set per workspace folder and per language (e.g. inside "[scss]": { … })

Command

PRem: Convert Selection to rem

  • Converts selected values like 16px, 24prem, 24pxrem, or bare numbers like 32 to rem
  • Bare numbers are treated as pixel values
  • The selection must contain exactly one value; surrounding whitespace is kept
  • Available from the Command Palette and the editor context menu when text is selected

Development

  • npm run compile builds into out/
  • npm test runs the unit tests for the conversion logic
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft