---
title: "What is difference between px, dp, dip and sp in Android?"  
description: "What is difference between px, dp, dip and sp in Android?"  
author: "Samuel Fernandes"  
published: 2015-04-23  
updated: 2015-04-23  
canonical: https://www.mindstick.com/forum/23114/what-is-difference-between-px-dp-dip-and-sp-in-android  
category: "android"  
tags: ["android"]  
reading_time: 2 minutes  

---

# What is difference between px, dp, dip and sp in Android?

how px, dp , dip and sp are differentiated in andriod, what is the [purpose](https://yourviews.mindstick.com/view/247/no-fail-policy-failing-its-purpose) and use of using different [dimensions](https://www.mindstick.com/forum/1834/c-sharp-xaml-how-to-modify-the-dimensions-of-the-rows-and-the-columns-of-a-grid)

## Replies

### Reply by Anonymous User

px is one pixel.sp is scale-independent pixels.dip is Density-independent pixels. \
You would use\
sp for font sizesdip for everything else.\
dip==dp![What is difference between px, dp, dip and sp in Android?](https://www.mindstick.com/mindstickforums/7ed17bc9-e863-4f83-8551-07fc5d9a8e9e/images/a6fe1c10-bd06-4e5e-8fe0-380ea6c3104f.png)\
\
**px**Pixels - corresponds to actual pixels on the screen.\
**in**Inches - based on the physical size of the screen.1 Inch = 2.54 centimeters\
**mm**Millimeters - based on the physical size of the screen.\
pt (it depends upon physical size of the screen) Points - 1/72 of an inch based on the physical size of the screen.\
**dp**Density-independent Pixels - an abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi screen, so one dp is one pixel on a 160 dpi screen. The ratio of dp-to-pixel will change with the screen density, but not necessarily in direct proportion. Note: The compiler accepts both "dip" and "dp", though "dp" is more consistent with "sp".\
**sp**Scale-independent Pixels - this is like the dp unit, but it is also scaled by the user's font size preference. It is recommend you use this unit when specifying font sizes, so they will be adjusted for both the screen density and user's preference.\
\


---

Original Source: https://www.mindstick.com/forum/23114/what-is-difference-between-px-dp-dip-and-sp-in-android

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
