Powershell Tip #56: Convert Decimal <> Hexadecimal By powershellgu | November 1, 2015 0 Comment Tip: You can convert to Base 16 from Base 10 and vice-versa. Decimal <> Hex PowerShell # To HEX '{0:X}' -f 1986 [System.Convert]::ToString(1986, 16) [System.String]::Format('{0:X}', 1986) # From HEX '{0:d}' -f 0x7C2 [System.Convert]::ToString(0x7C2, 10) [System.String]::Format('{0:d}', 0x7C2) 1234567891011 # To HEX '{0:X}' -f 1986[System.Convert]::ToString(1986, 16)[System.String]::Format('{0:X}', 1986) # From HEX '{0:d}' -f 0x7C2[System.Convert]::ToString(0x7C2, 10)[System.String]::Format('{0:d}', 0x7C2)