Decimal to Fraction

Enter a decimal number and convert it to a fraction (integer, numerator, denominator). Results appear instantly in your browser.

Decimal Number
Examples: 2.75, 0.333, 3.125
Fraction Result
Result will appear here
Quick Reference
0.5=1/2
0.25=1/4
0.75=3/4
0.125=1/8
0.375=3/8
0.2=1/5
0.0625=1/16
0.01=1/100
1.5=1 1/2
2.75=2 3/4
3.125=3 1/8
0.333=333/1000

Decimal to Fraction Converter

This tool converts a decimal number into its fraction equivalent, expressed as an integer part, numerator, and denominator. It is useful when you need to express decimal values as exact fractions for math, engineering, or cooking measurements.

The conversion runs entirely in your browser. The tool finds the simplest fraction representation by calculating the greatest common divisor (GCD).

How to use

  1. Enter a decimal number in the input field (e.g. 2.75 or 0.333).
  2. Click Convert to see the fraction result.
  3. The integer, numerator, and denominator are displayed separately.
  4. Use Copy to copy the fraction to your clipboard, or Clear to reset.

How it works

The tool separates the integer part from the decimal part, then converts the decimal part to a fraction. It multiplies the decimal by powers of 10 to eliminate the decimal point, then simplifies by dividing both numerator and denominator by their greatest common divisor (GCD).

Example

Decimal:     2.75
Fraction:    2 3/4

Decimal:     0.5
Fraction:    1/2

Decimal:     3.125
Fraction:    3 1/8

MCP integration

MCP (Model Context Protocol) lets AI agents and apps discover and run Coding.Tools utilities for repeatable conversions, formatting, hashing, and generation workflows.

MCP tool name: decimal-to-fraction

MCP endpoint: https://coding.tools/mcp

Call tools/list first. Each tool entry includes inputSchema, outputSchema, and examples so an AI agent or client can build valid arguments without guessing.

For tools/call, read result.content[0].text for the display value and result.structuredContent for machine parsing. Tool-level failures return isError: true; protocol failures return a JSON-RPC error.

Example tools/call request:

curl -s https://coding.tools/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "MCP-Protocol-Version: 2025-06-18" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"decimal-to-fraction","arguments":{"input":"0.125"}}}'

Most text and data tools accept an input string plus optional options. Browser-only image tools are listed for discovery and return a web UI link when they need browser image APIs.