---
title: "Converting Hex to integer in C#"  
description: "Converting Hex to integer in C#"  
author: "Anonymous User"  
published: 2013-01-29  
updated: 2013-01-29  
canonical: https://www.mindstick.com/forum/557/converting-hex-to-integer-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Converting Hex to integer in C#

Hi Everyone!

I want to [convert](https://www.mindstick.com/forum/2093/configurationmanager-appsettings-convert-n-to-n-why) Hex [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) into [Integer in C#](https://www.mindstick.com/forum/157646/write-a-program-to-test-a-switch-case-using-an-enum-as-a-string-not-an-integer-in-c-sharp). How it is possible? I'm try to convert Hex value into integer as below line of [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) but it generate [error](https://yourviews.mindstick.com/view/88527/fixing-quickbooks-error-4120-reinstalling-vs-repairing) "Some [String](https://www.mindstick.com/articles/1527/string-split-in-c-sharp) [Builder](https://www.mindstick.com/articles/12472/mgs-front-end-builder-for-magento-2-best-selling-product-on-magento-marketplace) Problems".

My line of code

[int](https://www.mindstick.com/forum/159137/how-to-convert-date-int-to-date-in-sql) x =(Value.ToString("x"));

Please help me!

Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)\

## Replies

### Reply by AVADHESH PATEL

Hi Jayprakash Sharma!

You can convert Hex value into [integer](https://answers.mindstick.com/qa/113667/write-code-for-roman-to-integer) like this

int iValue = Convert.ToInt32("17da06f1", 16);


---

Original Source: https://www.mindstick.com/forum/557/converting-hex-to-integer-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
