Go to Eclipse's Preferences → Java → Code Style → Formatter and export the settings to an XML file via the Export All button (or Edit and then Export in dialog that opens up). Then open IntelliJ IDEA Settings → Code Style → Java, click Manage, and import that XML file by simply clicking Import.
As of IntelliJ IDEA 13, there is no possibility to import .settings/.prefs files directly.
Edit: IntelliJ can import the following Eclipse properties:
- General
- Right margin, Formatter on/off tags
- Indentation
- Indent size
- Usage of ‘Tab’ character
- Usage of Tab only for leading indentation (Smart Tabs)
- Indent ‘case’ branches from ‘switch’
- Indent class members
- Keep comment at first column
- Spaces (Java)
- Before/after comma (as set for Eclipse method declaration parameters)
- After comma in type arguments
- Within array initializer braces
- Within brackets (in array reference)
- Within parentheses of: annotation, ‘for’, ‘if’, ‘catch’ ’while’, ’switch’, method, empty method, parenthesized expression, method call, type cast, ‘synchronized’
- Before parentheses of: ‘try’, ‘for’, ’while’, ‘switch’, method, ’if’, ‘catch’, method, method call, ‘synchronized’.
- After type cast
- Around unary, assignment operators (if it’s set for ‘before’ and ‘after’ in Eclipse).
- Before opening brace of: array initializer, ‘switch’
- Before ‘?’ in conditional expression
- Space before/after ‘:’ in conditional expression
- Space around binary operators (a single Eclipse setting is mapped to multiple IntelliJ IDEA’s settings)
- Blank lines
- Around fields and methods
- Before/after package
- Before/after imports
- Before method body
- Keep blank lines in code (number of empty lines to preserve)
- Wrapping
- New line before: closing brace in array initializer, ‘else’ in ‘if’ statement, ‘finally’ and ‘catch’ in ‘try’ statement, binary operator (if wrapped)
- New line after: opening brace in array initializer Special ‘else if’ treatment (compact ‘else if’)
- Keep simple blocks in one line
- Keep control statements in one line
- Alignment of: array initializer expressions, arguments in method declarations and calls, field declarations, extends list, assignments, binary expressions, ‘throws’ clause, resources in ‘try’.
- Brace style for: code blocks, methods and classes
- JavaDoc
- Enable JavaDoc formatting
- Blank lines in JavaDoc
Go to Eclipse's Preferences → Java → Code Style → Formatter and export the settings to an XML file via the Export All button (or Edit and then Export in dialog that opens up). Then open IntelliJ IDEA Settings → Code Style → Java, click Manage, and import that XML file by simply clicking Import.
As of IntelliJ IDEA 13, there is no possibility to import .settings/.prefs files directly.
Edit: IntelliJ can import the following Eclipse properties:
- General
- Right margin, Formatter on/off tags
- Indentation
- Indent size
- Usage of ‘Tab’ character
- Usage of Tab only for leading indentation (Smart Tabs)
- Indent ‘case’ branches from ‘switch’
- Indent class members
- Keep comment at first column
- Spaces (Java)
- Before/after comma (as set for Eclipse method declaration parameters)
- After comma in type arguments
- Within array initializer braces
- Within brackets (in array reference)
- Within parentheses of: annotation, ‘for’, ‘if’, ‘catch’ ’while’, ’switch’, method, empty method, parenthesized expression, method call, type cast, ‘synchronized’
- Before parentheses of: ‘try’, ‘for’, ’while’, ‘switch’, method, ’if’, ‘catch’, method, method call, ‘synchronized’.
- After type cast
- Around unary, assignment operators (if it’s set for ‘before’ and ‘after’ in Eclipse).
- Before opening brace of: array initializer, ‘switch’
- Before ‘?’ in conditional expression
- Space before/after ‘:’ in conditional expression
- Space around binary operators (a single Eclipse setting is mapped to multiple IntelliJ IDEA’s settings)
- Blank lines
- Around fields and methods
- Before/after package
- Before/after imports
- Before method body
- Keep blank lines in code (number of empty lines to preserve)
- Wrapping
- New line before: closing brace in array initializer, ‘else’ in ‘if’ statement, ‘finally’ and ‘catch’ in ‘try’ statement, binary operator (if wrapped)
- New line after: opening brace in array initializer Special ‘else if’ treatment (compact ‘else if’)
- Keep simple blocks in one line
- Keep control statements in one line
- Alignment of: array initializer expressions, arguments in method declarations and calls, field declarations, extends list, assignments, binary expressions, ‘throws’ clause, resources in ‘try’.
- Brace style for: code blocks, methods and classes
- JavaDoc
- Enable JavaDoc formatting
- Blank lines in JavaDoc
In the latest (2020) IntelliJ IDEA, if you have the "Eclipse interoperability" plugin installed, it's as simple as:
Settings > Editor > Code Style > Java > ⚙️ > Import Scheme > Eclipse XML Profile

Formatting Code
java - Importing code style formatting settings into eclipse from intellij-idea - Stack Overflow
java - Import IntelliJ formatter options into eclipse? - Stack Overflow
intellij idea - Import eclipse settings to intellijI - Stack Overflow
How to change the formatting of Eclipse IDE code to match the IntelliJ IDE format?
For example, the formatting of Streams in Eclipse bothers me, and I'd like to make it the same as IntelliJ's.
My laptop is too weak to download IntelliJ.
I couldn't find a ready plugin for that in 2018. So here is a side by side code style configuration from UI perspective of Intellij IDEA 2017.3 and Eclipse OXYGEN.3 March 2018. If both configured this way the code will be formatted close enough, so for example github will show you code differences so that it make sense.
For our project we configured one XML for each IDE so they more or less match:
- IntelliJ Config File is default of IDEA 2017.3 so not much to define in XML - enter link description here
- Eclipse Config is modified a bit from the default to match IntelliJ - link
- Here is also a PDF file to show all the options set in both IDEs side by side - link
There is also a project to solve this problem across more IDEs(Answer) : EditorConfig
There is a EditorConfig - independent format for editors/IDEs code style configuration. There are EditorConfig plugins for most popular editors(see full list here).
You can see examples for IntelliJ IDEA(tutorial) and Eclipse(plugin page).
With IntelliJ IDEA 13 you can also import eclipse Code formatting settings without the need of any plugins.
First you have to export those Code Formatter settings in eclipse. In eclipse go to the Preferences >> Java >> Code Style >> Formatter and export it via "Export All" option.
As a result, you will get a XML file.
In IntelliJ, go to File >> Other Settings >> Default Settings >> Code Style >> Java >> go to "Manage" >> go to "Import" and select that exported XML file.
Apply Changes and IntelliJ should format automatically now.
IntelliJ IDEA doesn't support Eclipse code style settings, however, there is a plug-in to use external Eclipse code formatting instead of the internal one, so that you will get the same formatting in Eclipse and in IntelliJ IDEA.
If CheckStyle is an option for you, consider using it as 'single source of truth':
- create CheckStyle config
- install CheckStyle plugins in both Eclipse and IDEA
- import formatter configs from CheckStyle config
See answers to related question.
I haven't tried it yet.
At the moment there is no way to export IntelliJ code style to eclipse. You need to do it the other way around.
You can also check IntelliJ plugin called "Eclipse Code Formatter" (link), but it the same way, from Eclipse to IntelliJ.
I'm using IntelliJ 14.1.4