Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8148915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:44:25+00:00 2026-06-06T14:44:25+00:00

How do i convert a value given as a hexadecimal string to an Octal

  • 0

How do i convert a value given as a hexadecimal string to an Octal format, when the number is too large to fit in a 64 bits number?

I currently convert a byte array to hex like this

Byte[] data = { 116, 4, 228, 18, 189, 145, 31, 7, 123, 74, 174, 151, 54, 144, 224, 49, 210, 169, 43, 213 };
hex = BitConverter.ToString(data).Replace("-", string.Empty);

Output in Hex:

7404E412BD911F077B4AAE973690E031D2A92BD5

How do I get the Octal representation?

So i tried this earlier, but it doesn’t work.

string binaryval = "";


  binaryval = Convert.ToString(Convert.ToInt32(hexValue,16), 8);

    foreach (char ch in hexValue)
    {

           binaryval += Convert.ToString(Convert.ToInt32(ch.ToString(), 16), 8);

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:44:26+00:00Added an answer on June 6, 2026 at 2:44 pm
    Byte[] data = { 116, 4, 228, 18, 189, 145, 31, 7, 123, 74, 174, 151, 54, 144, 224, 49, 210, 169, 43, 213};
    var str = String.Join("", data.Select(b => Convert.ToString(b,8).PadLeft(3,'0')));
    

    –

    //First hex string to byte array
    string hex = "7404E412BD911F077B4AAE973690E031D2A92BD5";
    List<byte> buf = new List<byte>();
    for (int i = 0; i< hex.Length / 2; i++) 
         buf.Add(Convert.ToByte(hex.Substring(i * 2, 2), 16));
    
    //Then to octal as above
    var str = String.Join("", buf.Select(b => Convert.ToString(b,8).PadLeft(3,'0')));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to convert double to string with given precision. String.format("%.3f", value) (or DecimalFormat
How to convert hexadecimal value into emoji icons , I have a string like
I'm currently given three values in a table A date value in the format
Given a string value eg 03252013 I need to convert this string to be
I need to convert time value strings given in the following format to seconds,
I have an app, and the username field will convert any given value to
Why is there a need to convert a value (for example short) to string,
How does one obtain the complementary hexadecimal value for a given input ? This
Given NSString *test = @2.98, how do I convert this value into float so
Given a double value like 1.00500000274996E-8, how do I convert it to it's non

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.