How do you convert between hexadecimal numbers and decimal numbers in C#?

# C# – How to convert numbers between hexadecimal and decimal

c++decimalhextype-conversion

###### Related Question

- Javascript – How to convert decimal to hexadecimal in JavaScript
- C# – How to enumerate an enum
- Java – How to round a number to n decimal places in Java
- C# – How to convert a byte array to a hexadecimal string, and vice versa
- .net – Difference between decimal, float and double in .NET
- C# – How to get the color from a hexadecimal color code using .NET
- Java – How to convert a String to an int in Java

## Best Solution

To convert from decimal to hex do...

To convert from hex to decimal do either...

or