TextText-based

text/x-kotlin

Kotlin Source

Reference for text/x-kotlin, the MIME type for Kotlin programming language source files used in Android and JVM development.

MIME Type Detector

Drop a file to detect its MIME type — no upload, runs in your browser

📄

Drop any file here or click to choose

Expected extensions: .kt, .kts

HTTP Content-Type Header

HTTP Header
Content-Type: text/x-kotlin; charset=utf-8

Associated File Extensions

.kt.kts

Quick Facts

MIME Typetext/x-kotlin
CategoryText
TypeText-based (human-readable)
Extensions.kt, .kts

Common Usage

Kotlin is the preferred language for Android development and runs on the JVM alongside Java. It is used for Android apps, server-side development (Ktor, Spring), multiplatform projects (KMP), and Gradle build scripts (.kts).

Kotlin offers null safety and concise syntax.

Code Examples

HTML
<!-- Link or embed with explicit type -->
<link rel="stylesheet" href="file.kt" type="text/x-kotlin">

<!-- Or for script/media elements -->
<script type="text/x-kotlin" src="file.kt"></script>
Node.js
// Express.js
app.get('/file', (req, res) => {
  res.type('text/x-kotlin');
  res.send(data);
});

// Node.js http
res.writeHead(200, { 'Content-Type': 'text/x-kotlin' });
nginx
# nginx.conf — add to types block or use default
types {
    text/x-kotlin  kt kts;
}

# Or set for a specific location
location /api/ {
    default_type text/x-kotlin;
}

Related MIME Types

More Text MIME Types

Other text types in the Text family

Related Tools

Explore More MIME Types

Browse our complete reference of 185 MIME types with usage examples, HTTP headers, and code snippets.