Calculator Tools Calculator Tools

TinyTip | Simple Tip Calculator & Bill Splitter

Sep 1, 2026

About this app

A tiny, responsive tip calculator and bill splitter app. Quickly calculate tips and split the bill with friends easily on mobile or desktop.

TinyTip | Simple Tip Calculator & Bill Splitter TinyTip Quick splits & easy tips Bill Total Tip Percentage 10% 15% 18% 20% 25% 30% Number of People Tip Amount per person $0.00 Total per person $0.00 Bill total: $0.00 Tip total: $0.00 Reset Everything

Put this on your site

Source

                    <html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">

<title>TinyTip | Simple Tip Calculator & Bill Splitter</title>
<meta name="description" content="A tiny, responsive tip calculator and bill splitter app. Quickly calculate tips and split the bill with friends easily on mobile or desktop.">
<meta name="keywords" content="tip calculator, bill splitter, dining tools, gratuity calculator, tiny tip app">

<!-- Libraries -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css" crossorigin="anonymous">

<script type="text/javascript">
try {
document.addEventListener("DOMContentLoaded", function() {
const billInput = document.getElementById('billAmount');
const tipButtons = document.querySelectorAll('.tip-btn');
const customTipInput = document.getElementById('customTip');
const splitInput = document.getElementById('splitCount');
const decreaseSplit = document.getElementById('decreaseSplit');
const increaseSplit = document.getElementById('increaseSplit');

const displayTipPerPerson = document.getElementById('tipPerPerson');
const displayTotalPerPerson = document.getElementById('totalPerPerson');
const displayTotalBill = document.getElementById('totalBillValue');
const displayTotalTip = document.getElementById('totalTipValue');

let selectedTipPercent = 15;

function calculate() {
const bill = parseFloat(billInput.value) || 0;
const split = parseInt(splitInput.value) || 1;
let tipPercent = selectedTipPercent;

if (customTipInput.value !== "") {
tipPercent = parseFloat(customTipInput.value) || 0;
}

const totalTip = bill * (tipPercent / 100);
const totalBill = bill + totalTip;
const tipPerPerson = totalTip / split;
const totalPerPerson = totalBill / split;

// Animate or update text
displayTipPerPerson.textContent = `$${tipPerPerson.toFixed(2)}`;
displayTotalPerPerson.textContent = `$${totalPerPerson.toFixed(2)}`;
displayTotalBill.textContent = `$${totalBill.toFixed(2)}`;
displayTotalTip.textContent = `$${totalTip.toFixed(2)}`;
}

// Tip Selection Logic
tipButtons.forEach(btn => {
btn.addEventListener('click', () => {
tipButtons.forEach(b => b.classList.remove('active'));
btn.classList.add('active');
customTipInput.value = "";
selectedTipPercent = parseFloat(btn.dataset.tip);
calculate();
});
});

customTipInput.addEventListener('input', () => {
tipButtons.forEach(b => b.classList.remove('active'));
calculate();
});

// Split Controls
decreaseSplit.addEventListener('click', () => {
let val = parseInt(splitInput.value) || 1;
if (val > 1) {
splitInput.value = val - 1;
calculate();
}
});

increaseSplit.addEventListener('click', () => {
let val = parseInt(splitInput.value) || 1;
splitInput.value = val + 1;
calculate();
});

// Input listeners
billInput.addEventListener('input', calculate);
splitInput.addEventListener('input', calculate);

// Clear form
document.getElementById('resetBtn').addEventListener('click', () => {
billInput.value = "";
customTipInput.value = "";
splitInput.value = 1;
tipButtons.forEach(b => b.classList.remove('active'));
document.querySelector('[data-tip="15"]').classList.add('active');
selectedTipPercent = 15;
calculate();
});

// Initial calc
calculate();
});

} catch (error) {
console.error("App Error:", error);
}
</script>

<style>
:root {
--primary-color: #6366f1;
--primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
--bg-color: #f8fafc;
--card-bg: #ffffff;
--text-main: #1e293b;
--text-muted: #64748b;
--accent-color: #22c55e;
}

*, *::before, *::after { box-sizing: border-box; }

body {
margin: 0;
padding: 0;
width: 100%;
max-width: 100%;
overflow-x: hidden;
background-color: var(--bg-color);
font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
color: var(--text-main);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}

#main-container {
width: 100%;
max-width: 480px;
padding: 1.5rem;
margin: auto;
}

.app-card {
background: var(--card-bg);
border-radius: 24px;
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
padding: 2rem;
overflow: hidden;
position: relative;
}

.header {
text-align: center;
margin-bottom: 2rem;
}

.header h1 {
font-weight: 800;
font-size: 1.75rem;
background: var(--primary-gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-bottom: 0.25rem;
}

.header p {
color: var(--text-muted);
font-size: 0.9rem;
}

.form-section {
margin-bottom: 1.5rem;
}

label {
display: block;
font-weight: 600;
margin-bottom: 0.5rem;
color: var(--text-main);
font-size: 0.95rem;
}

.input-group-custom {
position: relative;
display: flex;
align-items: center;
background: #f1f5f9;
border-radius: 12px;
padding: 0.25rem 0.75rem;
transition: all 0.2s ease;
}

.input-group-custom:focus-within {
background: #fff;
box-shadow: 0 0 0 2px var(--primary-color);
}

.input-group-custom i {
color: var(--text-muted);
margin-right: 0.5rem;
}

.input-group-custom input {
border: none;
background: transparent;
padding: 0.75rem 0;
width: 100%;
font-size: 1.1rem;
font-weight: 600;
color: var(--text-main);
}

.input-group-custom input:focus {
outline: none;
}

.tip-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 0.75rem;
margin-bottom: 1rem;
}

.tip-btn {
background: #f1f5f9;
border: none;
border-radius: 12px;
padding: 0.75rem;
font-weight: 700;
color: var(--text-main);
transition: all 0.2s ease;
cursor: pointer;
}

.tip-btn.active {
background: var(--primary-color);
color: white;
box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tip-btn:hover:not(.active) {
background: #e2e8f0;
}

.custom-tip-input {
grid-column: span 3;
}

.split-controls {
display: flex;
align-items: center;
gap: 1rem;
}

.circle-btn {
width: 44px;
height: 44px;
border-radius: 50%;
border: none;
background: var(--primary-color);
color: white;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.2rem;
transition: transform 0.1s active;
cursor: pointer;
}

.circle-btn:active {
transform: scale(0.9);
}

.results-panel {
background: var(--primary-gradient);
border-radius: 20px;
padding: 1.5rem;
margin-top: 2rem;
color: white;
box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.result-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}

.result-row:last-child {
margin-bottom: 0;
}

.result-label {
font-size: 0.85rem;
font-weight: 500;
opacity: 0.9;
}

.result-label span {
display: block;
font-size: 0.75rem;
opacity: 0.7;
}

.result-value {
font-size: 1.8rem;
font-weight: 800;
letter-spacing: -0.5px;
}

.mini-results {
border-top: 1px solid rgba(255, 255, 255, 0.2);
margin-top: 1rem;
padding-top: 1rem;
display: flex;
justify-content: space-between;
font-size: 0.8rem;
}

.reset-btn {
width: 100%;
background: transparent;
border: 2px solid #e2e8f0;
color: var(--text-muted);
padding: 0.75rem;
border-radius: 12px;
margin-top: 1.5rem;
font-weight: 600;
transition: all 0.2s ease;
}

.reset-btn:hover {
background: #f1f5f9;
color: var(--text-main);
}

/* Animations */
@keyframes bounceIn {
from { opacity: 0; transform: scale(0.95); }
to { opacity: 1; transform: scale(1); }
}

.app-card {
animation: bounceIn 0.5s ease-out;
}

/* Mobile Adjustments */
@media (max-width: 400px) {
.app-card {
padding: 1.25rem;
}
.result-value {
font-size: 1.5rem;
}
}
</style>
</head>
<body>
<div id="main-container">
<div class="app-card">
<header class="header">
<h1>TinyTip</h1>
<p>Quick splits & easy tips</p>
</header>

<div class="form-section">
<label for="billAmount">Bill Total</label>
<div class="input-group-custom">
<i class="fa-solid fa-dollar-sign"></i>
<input type="number" id="billAmount" placeholder="0.00" step="0.01" inputmode="decimal">
</div>
</div>

<div class="form-section">
<label>Tip Percentage</label>
<div class="tip-grid">
<button class="tip-btn" data-tip="10">10%</button>
<button class="tip-btn active" data-tip="15">15%</button>
<button class="tip-btn" data-tip="18">18%</button>
<button class="tip-btn" data-tip="20">20%</button>
<button class="tip-btn" data-tip="25">25%</button>
<button class="tip-btn" data-tip="30">30%</button>
<div class="input-group-custom custom-tip-input">
<i class="fa-solid fa-percentage"></i>
<input type="number" id="customTip" placeholder="Custom" inputmode="numeric">
</div>
</div>
</div>

<div class="form-section">
<label for="splitCount">Number of People</label>
<div class="split-controls">
<button class="circle-btn" id="decreaseSplit"><i class="fa-solid fa-minus"></i></button>
<div class="input-group-custom flex-grow-1">
<i class="fa-solid fa-user-group"></i>
<input type="number" id="splitCount" value="1" min="1" inputmode="numeric">
</div>
<button class="circle-btn" id="increaseSplit"><i class="fa-solid fa-plus"></i></button>
</div>
</div>

<div class="results-panel">
<div class="result-row">
<div class="result-label">
Tip Amount
<span>per person</span>
</div>
<div class="result-value" id="tipPerPerson">$0.00</div>
</div>
<div class="result-row">
<div class="result-label">
Total
<span>per person</span>
</div>
<div class="result-value" id="totalPerPerson">$0.00</div>
</div>

<div class="mini-results">
<div>
<span style="opacity: 0.7">Bill total:</span>
<strong id="totalBillValue">$0.00</strong>
</div>
<div>
<span style="opacity: 0.7">Tip total:</span>
<strong id="totalTipValue">$0.00</strong>
</div>
</div>
</div>

<button class="reset-btn" id="resetBtn">
<i class="fa-solid fa-rotate-left me-2"></i>Reset Everything
</button>
</div>
</div>
</body>
</html>