.vue

What is a .vue file?

A Vue SFC combines HTML template, JavaScript logic, and CSS styles in a single file.

Use caution
Type Code
By Evan You
MIME text/x-vue

Drop any file to identify it

No upload. No signup. No sending your file halfway across the internet.
We tell you what it is, right here in your browser.

What is it

Vue single-file components are the format that made component-based development feel natural. A .vue file has three sections: `<template>` for HTML, `<script>` for logic, and `<style>` for CSS. Everything about one component — how it looks, how it behaves, how it's styled — lives in one file. Open it and you understand the whole component at a glance.

The format requires a build step — Vue's compiler (via Vite, vue-cli, or webpack) transforms .vue files into JavaScript that browsers can execute. The `<style scoped>` feature automatically scopes CSS to the component, preventing style leaks. The `<script setup>` syntax (Vue 3) makes the JavaScript section remarkably concise.

VS Code with the Vue Language Features extension (Volar) provides syntax highlighting, type checking, and auto-completion for .vue files. WebStorm has built-in Vue support. Any text editor can open .vue files — they're plain text — but IDE support matters more here than for most file types because the file contains three different languages.

Technical details
Full Name
Vue.js Single-File Component
MIME Type
text/x-vue
Developer
Evan You
Magic Bytes
N/A
Safety
.vue requires caution. Source code file. Safe to read but executes when built and served.
What opens it
VS Code (+ Volar)
FREE Windows / Mac / Linux
WebStorm
$69/yr Windows / Mac / Linux
Any text editor
FREE Windows / Mac / Linux
FAQ
Can I open .vue files in a browser?
Not directly. Vue files must be compiled to JavaScript first using a build tool like Vite or vue-cli. The compiled output runs in browsers normally.
What's inside a .vue file?
Three optional sections: