⚖️ Ratio Simplifier

Free online ratio simplifier - reduce ratios to simplest form, supports fraction...

zerodependent·canofflineusing

🔢 Inputthanexample

📝 izesimple

thanexampleizesimpletoolcan what?

thanexampleizesimpletoolis Free OnlineTools, userwillthanexampleizesimpleformostsimple 。supports itemandmultipleitemthanexampleizesimple、smallnumberthanexampleprocess、separatenumberizesimple, showdetail izesimplestepandmostbigpublic numberCalculatethrough 。AllCalculateinBrowsetoolLocalcomplete,NoneedUploadData。

feature

using

1. inInput inInputthanexample,use No.(:)separate item

2. ToolsautodynamicCalculate showmostsimplethanexample

3. viewizesimplestepandGCD

4. using Mode subizesimplemultiple thanexample

Applyscenario

scenario1:number

and FastValidatethanexampleizesimpleResult, izesimplethrough 。

scenario2:config tunewhole

thanexampletunewhole config ,such as config 3:2:1tunewholefor6person 。

scenario3: Calculate

in and inizesimple than、zoomthanexampleetc。

extension

thanexampleizesimple number base ismostbigpublic number(GCD)。 number GCDiscan whenwholedivide mostbignormalinteger。 getalgorithmisCalculateGCD method:GCD(a,b) = GCD(b, a mod b),untilb=0whenai.e.forGCD。formultipleitemthanexample, before item GCD, andNo. item GCD,withthisclass 。

FAQ

thanexampleandseparatenumberhavewhatabout ?
thanexamplea:bcan workseparatenumbera/b。izesimplethanexample6:4etc inizesimpleseparatenumber6/4=3/2。thanexample3:2andseparatenumber3/2tableshowsame number about 。
such ashowprocess 0 thanexample?
thanexampleincancontains0,such as0:5izesimpleafter for0:5。but0cannotworkforseparate ,5:0isinvalidthanexample。
negativenumberthanexamplesuch ashowprocess?
negativenumberthanexample get forvalueizesimple, based on startsymbolconfirmsetResultsymbol。-6:4izesimplefor-3:2。
What is getalgorithm?
getalgorithmisCalculateGCD method:GCD(a,b)=GCD(b,a mod b), untilb=0。examplesuch asGCD(12,8)=GCD(8,4)=GCD(4,0)=4。

Ratio Simplifier | No Signup, Client-Side · No Server Uploads

Feedback: dexshuang@google.com

';return}let nums=parts.map(Number);let decimals=nums.map(n=>{const s=n.toString();const d=s.includes('.')?s.split('.')[1].length:0;return d});const maxDec=Math.max(...decimals);const multiplier=Math.pow(10,maxDec);nums=nums.map(n=>Math.round(n*multiplier));const g=gcdMulti(nums);const simplified=nums.map(n=>n/g);const isAlreadySimple=g===1;area.innerHTML=`
${simplified.join(' : ')}
startthanexample
${input}
mostbigpublic number
${g}
izesimplethanexample
${simplified.join(':')}
status
${isAlreadySimple?'Alreadyismostsimple':'Alreadyizesimple'}
1. parsethanexample: ${input}
${maxDec>0?`
2. dividesmallnumber: ×${multiplier} → ${nums.join(':')}
`:''}
${maxDec>0?'3':'2'}. CalculateGCD: GCD(${nums.join(', ')}) = ${g}
${maxDec>0?'4':'3'}. izesimple: ${nums.map(n=>`${n}÷${g}`).join(' : ')} = ${simplified.join(':')}
`} function batchSimplify(){const input=document.getElementById('batch-input').value.trim();const result=document.getElementById('batch-result');if(!input){result.textContent='';return}const lines=input.split('\n').filter(l=>l.trim());const results=lines.map(line=>{const parts=line.trim().split(':').map(s=>s.trim());if(parts.length<2||parts.some(p=>!p||isNaN(p)))return `${line} → invalid`;let nums=parts.map(Number);let decimals=nums.map(n=>{const s=n.toString();const d=s.includes('.')?s.split('.')[1].length:0;return d});const maxDec=Math.max(...decimals);const multiplier=Math.pow(10,maxDec);nums=nums.map(n=>Math.round(n*multiplier));const g=gcdMulti(nums);const simplified=nums.map(n=>n/g);return `${line} → ${simplified.join(':')}`});result.textContent=results.join('\n')} function loadExample(type){const input=document.getElementById('ratio-input');if(type==='simple')input.value='6:4';else if(type==='multi')input.value='12:8:16';else if(type==='decimal')input.value='1.5:2.0';simplify()} function clearAll(){document.getElementById('ratio-input').value='';document.getElementById('result-area').innerHTML='';document.getElementById('batch-input').value='';document.getElementById('batch-result').textContent=''} function copyBatch(){const text=document.getElementById('batch-result').textContent;if(!text)return;navigator.clipboard.writeText(text).then(()=>showToast())} function downloadBatch(){const text=document.getElementById('batch-result').textContent;if(!text)return;const blob=new Blob([text],{type:'text/plain'});const a=document.createElement('a');a.href=URL.createObjectURL(blob);a.download='simplified-ratios.txt';a.click()} document.addEventListener('keydown',function(e){if(e.ctrlKey&&e.key==='Enter'){e.preventDefault();simplify()}if(e.ctrlKey&&e.shiftKey&&e.key==='C'){e.preventDefault();copyBatch()}if(e.ctrlKey&&e.shiftKey&&e.key==='X'){e.preventDefault();clearAll()}}); function showToast(){const t=document.getElementById('copy-toast');t.classList.add('show');setTimeout(()=>t.classList.remove('show'),2000)} window.addEventListener('load',function(){loadExample('simple')});