Skip to content
ToolUlkaa Tool
All tools

Machine Learning

TensorFlow PlaygroundConfusion Matrix CalculatorROC Curve and AUC CalculatorK-Means Clustering VisualizerGradient Descent VisualizerDecision Tree BuilderClassifier PlaygroundPCA VisualizerActivation Function Plotter

Categories

AcademicTextMathematicsStatisticsMachine LearningAIData ScienceFile
All tools
Machine Learning

Entropy vs Gini in a Decision Tree

Switch between the two split criteria and compare the trees they build.

Try:
Commas, tabs or semicolons. Numeric columns split on a threshold; text columns get one branch per value. Rows with empty cells are skipped.
Split quality
1 to 12
2 or more
0 to 50

Source: A 30-passenger teaching subset of the Titanic passenger list (class, sex, age, survived), a historical record in the public domain, entered by hand. It is a small illustration, not a research sample.

Test accuracy

83.3%

The tree was grown on 24 rows and checked on 6 rows it never saw (a fixed, repeatable split). A big gap between training accuracy (87.5%) and test accuracy is the sign of overfitting.

Training accuracy
87.5%
24 rows
Test accuracy
83.3%
6 rows
Depth
4
15 nodes, 8 leaves
Root impurity
1
entropy
Root information gain
0.2643
Classes
2
no, yes

Tree

female<= 2.5> 2.5<= 6> 6<= 11> 11male<= 34.5<= 25> 25<= 1.5> 1.5> 34.5sexentropy = 1, n = 24[12, 12]nopclass <= 2.5entropy = 0.779, n = 13[3, 10]yesleafentropy = 0, n = 4[0, 4]yesage <= 6entropy = 0.918, n = 9[3, 6]yesleafentropy = 0, n = 1[0, 1]yesage <= 11entropy = 0.954, n = 8[3, 5]yesleafentropy = 0, n = 1[1, 0]noleafentropy = 0.863, n = 7[2, 5]yesage <= 34.5entropy = 0.684, n = 11[9, 2]noage <= 25entropy = 0.918, n = 6[4, 2]noleafentropy = 0, n = 3[3, 0]nopclass <= 1.5entropy = 0.918, n = 3[1, 2]yesleafentropy = 1, n = 2[1, 1]noleafentropy = 0, n = 1[0, 1]yesleafentropy = 0, n = 5[5, 0]no

Each box shows the split, the entropy value, the number of rows, the count of rows per class ([no, yes]) and the majority class. Tap a box to fold its branch. Scroll sideways on a small screen.

Feature importance

  • age43.8%
  • sex39.8%
  • pclass16.4%

Importance is the share of the total impurity reduction that each feature's splits produced, weighted by the rows they covered.

The tree as rules

Show 22 lines of if-then rules
if sex = female:
  if pclass <= 2.5:
    predict yes (4 rows)
  if pclass > 2.5:
    if age <= 6:
      predict yes (1 rows)
    if age > 6:
      if age <= 11:
        predict no (1 rows)
      if age > 11:
        predict yes (7 rows)
if sex = male:
  if age <= 34.5:
    if age <= 25:
      predict no (3 rows)
    if age > 25:
      if pclass <= 1.5:
        predict no (2 rows)
      if pclass > 1.5:
        predict yes (1 rows)
  if age > 34.5:
    predict no (5 rows)
  1. Tools
  2. Machine Learning
  3. Decision Tree Builder
  4. Entropy vs Gini in a Decision Tree

About Entropy vs Gini in a Decision Tree

This page opens on the Titanic subset with entropy as the split criterion. Switch to Gini impurity and compare the root split, the shape of the tree and the accuracy. It is free, needs no sign-up and runs in your browser, so nothing you enter is uploaded.

Gini and entropy are both zero for a pure node and largest for an even mix, and their curves are close in shape. Entropy penalises mixed nodes slightly more strongly near the extremes, and Gini is a little cheaper to compute because it needs no logarithm. In practice they choose the same split most of the time.

When they disagree it is usually deep in the tree, among splits of almost equal quality. The numbers on this page come from the same rows, depth and test split; only the criterion differs.

How to use Entropy vs Gini in a Decision Tree

  1. 1Pick a sample dataset, or paste your own CSV with a header row.
  2. 2Choose the target column, the one you want to predict. It should have a handful of classes.
  3. 3Choose Gini impurity or entropy, and set the maximum depth and the minimum number of rows needed to split a node.
  4. 4Set a test share, for example 20%, to hold some rows back and measure accuracy on unseen data.
  5. 5Read the accuracy figures, then look at the tree. Tap a box to fold its branch, or scroll sideways on a small screen.
  6. 6Check the feature importance chart, and open the rules to copy the tree as text.

Features

  • Numeric columns split on a threshold; text columns get one branch per value.
  • Gini impurity or entropy as the split quality measure.
  • Maximum depth, minimum rows to split and a repeatable train and test split.
  • A tree diagram in responsive SVG with foldable branches, scrollable on phones.
  • Feature importance as the share of total impurity reduction.
  • Root impurity and information gain, so you can check a textbook calculation.
  • The tree as if-then rules, which you can copy.
  • Iris, a Titanic subset and play-tennis built in, with their sources stated.

Worked examples

  • Titanic subset, depth 4, 20% test → gives entropy: 15 nodes, test 83.3%; Gini: 15 nodes, test 83.3%

    Both roots: sex (entropy) and sex (Gini).

Privacy: how it works

  • Your CSV is parsed and the tree is grown in your browser tab. Nothing is sent to Ulkaa or anyone else.

Tips

  • Remove ID columns, names and anything that would not be known when you need to predict.
  • Compare Gini and entropy on your data. They usually pick the same splits and differ only in the details.
  • Fold the branches of a big tree and read the top levels first. Those hold the strongest signals.
  • The test split is random but repeatable, so the same settings always give the same numbers.

Frequently asked questions

Is it really free?

Yes. There is no price, no trial and no credit card. Ulkaa Tool does the work with your own device, so there is no server bill to pass on to you.

Do I need an account?

No. There is no sign-up and no login. Open the page and use it. An Ulkaa account is not needed for anything on this tool.

Does it run in my browser?

Yes. Your CSV data are processed by code running in your browser tab, on your own device.

Is my data uploaded?

No. Your CSV data are never sent to Ulkaa or to anyone else. You can check this yourself by watching the Network tab in your browser developer tools while you use the tool.

Which is better, Gini or entropy?

Neither is consistently better. They usually pick the same splits. Gini is slightly faster, and entropy is more common in textbooks.

Do Gini and entropy give the same tree?

Often, but not always. They can differ on close calls, especially lower in the tree.

More Decision Tree Builder pages

  • Decision Tree BuilderPaste a CSV, choose the column to predict and watch a decision tree grow, split by split.
  • Play Tennis Decision TreeThe textbook 14-day table, turned into a tree with entropy and information gain.
  • Titanic Survival Decision TreePredict who survived from class, sex and age with a small, readable tree.
  • Gini Impurity CalculatorSee the Gini impurity of a node and of its children after the best split.
  • Information Gain CalculatorCompute the entropy of a node and the information gain of the best split.
  • Decision Tree Feature ImportanceRank the columns of your data by how much a tree depends on them.
  • Decision Tree OverfittingGrow an unrestricted tree and compare its training and test accuracy.

Ulkaa Apps

  • Ulkaa
  • Calendar
  • Task
  • Note
  • Disk
  • Call
  • Contact
  • Mail
  • Finance
  • Health
  • Office
  • Work
  • Workspace
  • Halum
  • Jaal
  • Islam
  • Game
  • Weather
  • Campus
  • News
  • Developer
  • Help
  • Account
About·Privacy·Terms·© 2026 Ulkaa

What is Ulkaa Tool?

Ulkaa Tool is a free collection of fast, privacy-friendly online tools from Ulkaa Network. Calculate your GPA and CGPA, edit rich text, count words and characters, replace text and more — all in your browser.

Every tool runs entirely in your browser — no sign-up, and your data never leaves your device.

Academic

  • GPA Calculator
  • CGPA Calculator
  • Citation Generator
  • Quiz Maker

Text

  • Rich Text Editor
  • Word Counter
  • Character Counter
  • Text Replacement

Ulkaa

  • Ulkaa
  • Ulkaa News
  • Ulkaa Campus
  • Ulkaa Tool
  • Ulkaa Game
  • Ulkaa Weather
  • Ulkaa Islam

Company

  • About Ulkaa
  • Careers
  • Support
  • Help
  • Privacy Policy
  • Terms of Service
  • Disclaimer
  • Sitemap

© 2015-26, Ulkaa. All rights reserved.
Facebook PageLinkedIn CompanyX (Twitter) ProfileInstagram ProfileGitHub Account