<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/shrinking-a-kotlin-binary-by-99-2--wkroq1dro" -->

---
title: Shrinking a Kotlin binary by 99.2% | daily.dev
description: Jake Wharton walks through shrinking a Kotlin JVM binary from ~1.62MiB to ~13KiB (99.2% reduction) for a dependency-tree-diff tool. The process involves:...
canonical: https://daily.dev/posts/shrinking-a-kotlin-binary-by-99-2--wkroq1dro
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Shrinking a Kotlin binary by 99.2% | daily.dev
og:description: Jake Wharton walks through shrinking a Kotlin JVM binary from ~1.62MiB to ~13KiB (99.2% reduction) for a dependency-tree-diff tool. The process involves:...
og:url: https://daily.dev/posts/shrinking-a-kotlin-binary-by-99-2--wkroq1dro
og:image: https://api.daily.dev/og/posts/WkROQ1dRo.png
og:image:alt: Shrinking a Kotlin binary by 99.2%
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Shrinking a Kotlin binary by 99.2%

**[Jake Wharton](https://daily.dev/sources/jakewharton)** · 8 min read · 0 upvotes · 0 comments

## Summary

Jake Wharton walks through shrinking a Kotlin JVM binary from ~1.62MiB to ~13KiB (99.2% reduction) for a dependency-tree-diff tool. The process involves: removing unused metadata files (.kotlin_module, .kotlin_metadata, maven files) for an 11% reduction, running R8 with ProGuard config to strip unused code for a 98% reduction, then manually replacing Kotlin stdlib file-reading and line-splitting APIs with Java NIO equivalents to eliminate transitive dependencies. The post also identifies remaining size contributors — Kotlin's multiplatform empty collection implementations and redundant null-check intrinsics — and recommends R8/ProGuard or GraalVM native image for anyone building JVM binaries.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://jakewharton.com/shrinking-a-kotlin-binary>

## Similar posts on daily.dev

- [Honey, I shrank the JARs - Mostly nerdless](https://daily.dev/posts/honey-i-shrank-the-jars---mostly-nerdless-ndnbulwiu) · Mostly Nerdless · 19 upvotes · 1 comments
- [GraalVM CE 25.1.3 Gets Native Image "Hello World" Program Down To <em>Just</em> 6.5MB](https://daily.dev/posts/graalvm-ce-25-1-3-gets-native-image-hello-world-program-down-to-em-just-em-6-5mb-qnvqrhoox) · Phoronix · 0 upvotes · 0 comments

---

Tags: [#kotlin](https://daily.dev/tags/kotlin), [#jvm](https://daily.dev/tags/jvm)

[View this post on daily.dev](https://daily.dev/posts/shrinking-a-kotlin-binary-by-99-2--wkroq1dro)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Shrinking a Kotlin binary by 99.2%","url":"https://daily.dev/posts/shrinking-a-kotlin-binary-by-99-2--wkroq1dro","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/shrinking-a-kotlin-binary-by-99-2--wkroq1dro"},"datePublished":"2026-07-05T07:14:22.683Z","dateModified":"2026-07-05T07:18:06.300Z","description":"Jake Wharton walks through shrinking a Kotlin JVM binary from ~1.62MiB to ~13KiB (99.2% reduction) for a dependency-tree-diff tool. The process involves:...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/783b359bc344ce8763770516ac461830?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/783b359bc344ce8763770516ac461830?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Jake Wharton","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Jake Wharton","logo":"https://media.daily.dev/image/upload/logos/placeholder.jpg","url":"https://daily.dev/sources/jakewharton"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/shrinking-a-kotlin-binary-by-99-2--wkroq1dro","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"kotlin,jvm","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Jake Wharton","item":"https://daily.dev/sources/jakewharton"},{"@type":"ListItem","position":3,"name":"Shrinking a Kotlin binary by 99.2%"}]}
```

