From IntelliJ, export the eclipse formatter file (XML) from settings > editor > Code style > Java

In Vscode you can download the extension - Language Support for Java™ by Red Hat which can import setting from XML files.

In Vscode > user - settings.json add the following

"java.format.enabled": true,
"java.format.settings.url": "https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml",
"[java]": {
    "editor.defaultFormatter": "redhat.java"
}

you can replace the URL with the local file path or a GitHub XML raw file link (of the previously exported IntelliJ XML file)

for more information on the Vscode extension, you can refer following links

  • https://code.visualstudio.com/docs/java/java-linting
  • https://github.com/redhat-developer/vscode-java/wiki/Formatter-settings

However, do note that there still might be differences in formatting between both IDEs (I think it's due to IntelliJ having a separate IntelliJ code style XML along with Eclipse XML which overrides some rules). I prefer to use the eclipse-java-google-style.xml on both IDEs as it seems more consistent while formatting.

Answer from Nithin P M on Stack Overflow
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360003100859-Export-IDEA-style-settings-for-VSCode
Export IDEA style settings for VSCode – IDEs Support (IntelliJ Platform) | JetBrains
February 21, 2019 - You could ask VSCode developers to add import for IDEA code style settings. ... So basically what you are saying, that there is no way at the moment, to create same code style environment between two IDEAs by exporting settings from IDEA into VSCode or vice versa. ... Yes, currently it's possible only through editorconfig. ... is there any 2022 updates on this? would it be possible in intellij to export .editorconfig for vscode?
Discussions

Provide formatter for IntelliJ default format setting
I have several projects using IntelliJ developed and the formatter using the default IntelliJ setting. I would like to develop the code in VSCode Java( which i really love), but the formatting is a big blocking for me. I don't want to mi... More on github.com
🌐 github.com
6
July 23, 2019
Need to import Eclipse Java Formatter profile in Visual Studio Code - Stack Overflow
I am looking for solution for importing Eclipse Java Formatter Profile in Visual Studio Code. In order to go with coding complaince. For example in IntelliJ and Eclipse for Java we do this way: More on stackoverflow.com
🌐 stackoverflow.com
How to make VS Code organize Java imports like IntelliJ - Stack Overflow
I'm using VS Code for Java development and working with other developers who use IntelliJ. I'd like to use the Organize Imports command (Shift+Alt+O) to clean up my imports, but I don't want to fight More on stackoverflow.com
🌐 stackoverflow.com
VScode default formatter for Intellij
I'm sorry, I'm talking about frontend - Angular, so html, css/scss, ts, js More on reddit.com
🌐 r/IntelliJIDEA
3
0
April 2, 2025
🌐
Stack Overflow
stackoverflow.com › questions › 57292625 › how-i-can-import-code-style-from-webstorm-to-visual-studio-code
intellij idea - How I can import Code Style from WebStorm to Visual Studio Code? - Stack Overflow
... In the Settings/Preferences dialog (Ctrl+Alt+S), go to Editor | Code Style, select the desired scheme from the list, and click the Show Scheme Actions button. ... Copy to IDE: select this option to store the selected scheme in the global level.
🌐
Iterators
iteratorshq.com › home › tech blog › migrating from intellij idea to vscode and metals – staying productive at writing scala
Migrating from IntelliJ IDEA to VSCode and Metals – Staying Productive at Writing Scala | Iterators
September 5, 2023 - You can also skip those steps and just jump straight into a Gitpod with preinstalled VSCode and Metals. This will launch a session with a prebuilt coding environment in just a matter of seconds. Getting used to new keybindings in a new editor can be burdensome – you might want to stick to a setup you already know. This is where IntelliJ Importer comes to the rescue. If you don’t have any customized keybindings to import, this plugin can always provide you the default IntelliJ ones. You can also export your IntelliJ Code Style settings to a .editorconfig file and import it to the new editor, although the file in the majority will contain only IntelliJ specific options that won’t be unfortunately understood by VSCode.
🌐
Medium
medium.com › @nithinpm09 › how-to-use-intellij-formatter-in-vscode-82d6ff4b0161
How to use IntelliJ formatter in Vscode | by Nithin P M | Medium
May 24, 2023 - From IntelliJ, export the eclipse formatter file (XML) from settings > editor > Code Style > Java. ... In Vscode you can download the extension — Language Support for Java™ by Red Hat which can import settings from XML files.
🌐
GitHub
github.com › redhat-developer › vscode-java › issues › 998
Provide formatter for IntelliJ default format setting · Issue #998 · redhat-developer/vscode-java
July 23, 2019 - I have several projects using IntelliJ developed and the formatter using the default IntelliJ setting. I would like to develop the code in VSCode Java( which i really love), but the formatting is a big blocking for me. I don't want to mi...
Author: redhat-developer
Find elsewhere
Top answer
1 of 2
44

We were able to get it the almost identical with the following config tweaks.

VS Code:

{
  "java.completion.importOrder": [
    "",
    "javax",
    "java",
    "#"
  ]
}

IntelliJ

The only difference from the IntelliJ default is a new line between import javax... and import java....

2 of 2
3

It's possible to get VS Code and IntelliJ to agree on a standard format, as long as that standard format:

  1. Puts static imports at the top*
  2. Separates all specific sections with empty lines
  3. Puts everything not in its own specific section in a catch-all section at the end*
  4. Never uses wildcard imports

    • Not actually true; static imports can be positioned in VS Code with '#', and everything else can be position in VS Code with ''.

IntelliJ's default settings don't work for this, but it is flexible enough to be reconfigured. Here are the files to add to a project to make just that project set up consistent rules for both IDEs (make sure they are not excluded in .gitignore).

Rule: The following groups separated by empty lines: Static imports, java.*, javax.*, everything else.

.vscode/settings.json:

{
    "java.completion.importOrder": ["java", "javax"],
}

.idea/codeStyles/codeStyleConfig.xml:

<component name="ProjectCodeStyleConfiguration">
  <state>
    <option name="USE_PER_PROJECT_SETTINGS" value="true" />
  </state>
</component>

.idea/codeStyles/Project.xml

<component name="ProjectCodeStyleConfiguration">
  <code_scheme name="Project" version="173">
    <JavaCodeStyleSettings>
      <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
      <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
      <option name="IMPORT_LAYOUT_TABLE">
        <value>
          <package name="" withSubpackages="true" static="true" />
          <emptyLine />
          <package name="java" withSubpackages="true" static="false" />
          <emptyLine />
          <package name="javax" withSubpackages="true" static="false" />
          <emptyLine />
          <package name="" withSubpackages="true" static="false" />
        </value>
      </option>
    </JavaCodeStyleSettings>
  </code_scheme>
</component>
🌐
JetBrains
jetbrains.com › help › idea › how-to-move-to-intellij-idea-from-vs-code.html
Migrate from VS Code to IntelliJ IDEA | IntelliJ IDEA Documentation
August 17, 2026 - In this section, you will find some tips on how to migrate from Visual Studio Code (VS Code) to IntelliJ IDEA. If you are looking for an overview of the features IntelliJ IDEA offers, refer to Features Overview on the JetBrains website. To help you recreate your previous setup, IntelliJ IDEA allows you to import settings from your VS Code instance.
🌐
JetBrains
jetbrains.com › help › idea › configuring-code-style.html
Code style schemes | IntelliJ IDEA Documentation
August 17, 2026 - Press Ctrl+Alt+S to open settings and then select Editor | Code Style. Click Show Scheme Actions and select Import Scheme. Then select the necessary format. In the dialog that opens, select the file with the settings and click Open.
🌐
Reddit
reddit.com › r/intellijidea › vscode default formatter for intellij
r/IntelliJIDEA on Reddit: VScode default formatter for Intellij
April 2, 2025 -

Hello. I'm starting on new project where everyone is using VSCode. They are using default formatter instead of prettier and they don't want to change it. Exist some way to export and import these settings from VScode to Intelij? I try find something but I'm lost. Thank you.

🌐
GitHub
github.com › redhat-developer › vscode-java › issues › 2908
How to transform `IntelliJ IDEA Community Edition`'s formatter implementation to `redhat.java` plugin from https://github.com/JetBrains/intellij-community · Issue #2908 · redhat-developer/vscode-java
January 28, 2023 - Export code style settings as Eclipse XML Profile from IntelliJ IDEA 22.3.1 -> Settings->Editor->Code Style->Schema named as style.xml under path c:\Users\yi\style.xml · Assign file://c:/Users/yi/style.xml to java.format.settings.url in vscode settings.json ·
Author: redhat-developer
🌐
Medium
medium.com › @spaghett1c0de › the-ultimate-intellij-idea-️visual-studio-code-experience-4b24f7de3b92
The Ultimate IntelliJ IDEA Plus Visual Studio Code Experience | by Vincent Liu | Medium
April 14, 2020 - A standardized styling guide goes a long way for any collaboration projects. It sets the ground rules for formatting your code in a certain way. I use Google Style Guides most of the time for my projects. In IntelliJ, it’s as easy as going into the marketplace and download the Google Java Format plugin.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
IntelliJ Code Formatter for VSCode
Extension for Visual Studio Code - Format code using IntelliJ IDEA's formatting engine
🌐
LYRASIS Wiki
wiki.lyrasis.org › display › VIVO › Code+Style+Guide
Code Style Guide - VIVO - LYRASIS Wiki
February 24, 2023 - In older versions of IntelliJ, this menu may be under File → Settings → Other Settings → Checkstyle · Add a "Configuration File" (press the + in the table). Select VIVO/Vitro checkstyle.xml ... Update IDEA's Code Style to obey the Checkstyle Rules (See also https://stackoverflow.com/a/35273850/3750035) ... After importing ...
🌐
GitHub
github.com › duraspace › codestyle › blob › master › ide-support › intellij.md
codestyle/ide-support/intellij.md at master · duraspace/codestyle
There are two ways to sync the IntelliJ Code Style settings with your Checkstyle settings. Importing a pre-configured code style scheme is the simplest and most likely to provide consistent results.
Author: duraspace