http://www.atool.org/hexconvert.php
SS = "[Email protected]";functionV10tox (n, m) {m= String (M). Replace (//gi, "");if(M = = "") { return"" } varA = SS.SUBSTR (0, 10); varb = A + "."; if(Eval ("M.replace (/[" + B + "]/gi,") ")! =" ") {M ("Please enter a valid binary number!" "); return""} m= M.split ("."); if(M.length > 2) {M ("Please enter a valid binary number!" "); return"" } varA = SS.SUBSTR (0, N); if(M.length = = 1) {m= M[0]; vart = ""; while(M! = 0) { varb = m%N; T= A.charat (b) +T; M= (m-b)/N}returnT}Else { varM0 = m[0]; vart = ""; while(M0! = 0) { varb = M0%N; T= A.charat (b) +T; M0= (m0-b)/N}varCNT = 18; varM1 = M[1]; M1= Parsefloat ("0." +M1); varD = "", B = 0; while(M1! = 0 && cnt > 0) {M1= M1 *N; b=parseint (M1); D= d +A.charat (b); M1= M1-b; CNT-- } returnT + "." +D}}functionvXto10 (n, m) {m= String (M). Replace (//gi, "");if(M = = "") { return"" } varA = SS.SUBSTR (0, N); varb = A + "."; if(Eval ("M.replace (/[" + B + "]/gi,") ")! =" ") {M ("Please enter a valid" + N + "binary number! "); return""} m= M.split ("."); if(M.length > 2) {M ("Please enter a valid" + N + "binary number! "); return"" } if(M.length = = 1) {m= M[0]; vart = 0, c = 1; for(varx = m.length-1; x >-1; x--) {T+ = c *(A.indexof (M.charat (x))); C*=N}returnT}Else { varM0 = m[0]; vart = 0, c = 1; for(varx = m0.length-1; x >-1; x--) {T+ = c *(A.indexof (M0.charat (x))); C*=N}varM1 = M[1]; vard = 0, c = 1/N; for(varx = 0; x < m1.length; X + +) {D+ = c *(A.indexof (M1.charat (x))); C/= N } returnT +D}}functionVxtoy (d, B, c) {a= VXto10 (d * 1, B); if(A = = "")) { return""} a=V10tox (c, a); returnA}functionM (b) {alert (b)}functionCONVERT (g, H, I, f) {varE =document.getElementById (h). value; varD =document.getElementById (f); varb =document.getElementById (g). value; varc =document.getElementById (i). value; D.value=Vxtoy (b, E, c)}functionConvert_c (g, E, F, d) {varc =document.getElementById (e). value; varb =document.getElementById (d); B.value=Vxtoy (g, C, f)};
<div class= "Row" >
<span class= "span strong" > Binary:</span>
<div class= "span four Xs-four" >
<input type= "text" id= "bin_1" alt= "binary number" title= "binary number" class= "Input-text" value= "10011110101110110100010" >
</div>
<span class= "span Strong" > Decimal:</span>
<div class= "span four Xs-four" >
<input type= "text" id= "ten_1" alt= "decimal number" title= "decimal number" class= "Input-text" value= "" >
</div>
<button class= "button primary small" type= "button" onclick= "convert_c (2, ' bin_1 ', ten, ' ten_1 ');" > Conversion </button>
</div>
Online arbitrary conversion tool-Atool online tool