diff --git a/docs/develop/parser.md b/docs/develop/parser.md
index b340fefd841f8ca9aa52a245b38c196123e53873..4a24131d60c1e3cb712faeaf1359230699a3d2e9 100644
--- a/docs/develop/parser.md
+++ b/docs/develop/parser.md
@@ -283,7 +283,10 @@ class ExampleParser(MatchingParser):
         super().__init__(
             name='parsers/example', code_name='EXAMPLE', code_homepage='https://www.example.eu/',
             mainfile_mime_re=r'(application/.*)|(text/.*)',
-            mainfile_contents_re=(r'^\s*#\s*This is example output'))
+            mainfile_contents_re=(r'^\s*#\s*This is example output'),
+            supported_compressions=["gz", "bz2", "xz"],
+            mainfile_alternative=False,
+            mainfile_contents_dict={'program': {'version': '1', 'name': 'EXAMPLE'}})
 ```
 
 - `mainfile_mime_re`: A regular expression on the mime type of files. The parser is run only
@@ -291,6 +294,11 @@ class ExampleParser(MatchingParser):
 - `mainfile_contents_re`: A regular expression that is applied to the first 4k of a file.
 The parser is run only on files where this matches.
 - `mainfile_name_re`: A regular expression that can be used to match against the name and path of the file.
+- `supported compressions`: A list of [gz, bz2], if the parser supports compressed files
+- `mainfile_alternative`: If True files are mainfile if no mainfile_name_re matching file
+is present in the same directory.
+- `mainfile_contents_dict`: A dictionary to match the contents of the file. If provided
+will load the file and match the value of the key(s) provided.
 
 Not all of these attributes have to be used. Those that are given must all match in order
 to use the parser on a file.
diff --git a/nomad/parsing/parser.py b/nomad/parsing/parser.py
index 7a790dc4f93163578a3e9317417246ad06a57c05..14c739dac5cf0591e1070f8adc678bf2cf32baf9 100644
--- a/nomad/parsing/parser.py
+++ b/nomad/parsing/parser.py
@@ -26,6 +26,8 @@ from functools import lru_cache
 import importlib
 from pydantic import BaseModel, Extra  # pylint: disable=unused-import
 import yaml
+import h5py
+import numpy as np
 
 from nomad import config, utils
 from nomad.datamodel import EntryArchive, EntryMetadata
@@ -186,6 +188,8 @@ class MatchingParser(Parser):
         mainfile_mime_re: A regexp that is used to match against a files mime type
         mainfile_contents_re: A regexp that is used to match the first 1024 bytes of a
             potential mainfile.
+        mainfile_contents_dict: A nested dictionary to match the contents of the file. If provided
+            will load the file and match the value of the key(s) provided.
         mainfile_name_re: A regexp that is used to match the paths of potential mainfiles
         mainfile_alternative: If True files are mainfile if no mainfile_name_re matching file
             is present in the same directory.
@@ -205,6 +209,7 @@ class MatchingParser(Parser):
             mainfile_mime_re: str = r'text/.*',
             mainfile_name_re: str = r'.*',
             mainfile_alternative: bool = False,
+            mainfile_contents_dict: dict = None,
             domain='dft',
             supported_compressions: List[str] = []) -> None:
 
@@ -254,6 +259,7 @@ class MatchingParser(Parser):
             self._mainfile_binary_header_re = re.compile(mainfile_binary_header_re)
         else:
             self._mainfile_binary_header_re = None
+        self._mainfile_contents_dict = mainfile_contents_dict
         self._supported_compressions = supported_compressions
 
         self._ls = lru_cache(maxsize=16)(lambda directory: os.listdir(directory))
@@ -313,6 +319,41 @@ class MatchingParser(Parser):
                 if sibling_is_mainfile:
                     return False
 
+        if self._mainfile_contents_dict is not None:
+            is_match = False
+            if mime.startswith('application/x-hdf'):
+                try:
+                    def match(value, reference):
+                        if not isinstance(value, dict):
+                            equal = value == reference[()]
+                            return equal.all() if isinstance(equal, np.ndarray) else equal
+
+                        if not hasattr(reference, 'keys'):
+                            return False
+
+                        matches = []
+                        reference_keys = list(reference.keys())
+                        for key, val in value.items():
+                            if key == '__has_key':
+                                matches.append(val in reference_keys)
+                            elif key == '__has_all_keys':
+                                assert isinstance(val, list)
+                                matches.append(False not in [v in reference_keys for v in val])
+                            else:
+                                if key not in reference_keys:
+                                    matches.append(False)
+                                    continue
+
+                                matches.append(match(val, reference[key]))
+                        return False not in matches
+
+                    with h5py.File(filename) as f:
+                        is_match = match(self._mainfile_contents_dict, f)
+                except Exception:
+                    pass
+            if not is_match:
+                return False
+
         return True
 
     def parse(self, mainfile: str, archive: EntryArchive, logger=None, child_archives=None) -> None:
diff --git a/nomad/parsing/parsers.py b/nomad/parsing/parsers.py
index 41add0d3f5bbee6e0650d2bca801669fdeda7c15..f67d8501c06cbed7e683ff180d47d6d8954a34f9 100644
--- a/nomad/parsing/parsers.py
+++ b/nomad/parsing/parsers.py
@@ -552,8 +552,10 @@ parsers = [
     MatchingParserInterface(
         'workflowparsers.FHIVibesParser',
         metadata_path=f'{prefix_workflow}/fhivibes/metadata.yaml',
-        mainfile_name_re=(r'^.*\.(nc)$'), mainfile_mime_re=r'(application/x-hdf)',
-        mainfile_binary_header_re=br'^\x89HDF'
+        mainfile_name_re=(r'^.*\.(nc)$'),
+        mainfile_mime_re=r'(application/x-hdf)',
+        mainfile_binary_header_re=br'^\x89HDF',
+        mainfile_contents_dict={'__has_all_keys': ['I', 'a', 'b']}
     ),
     MatchingParserInterface(
         'workflowparsers.LobsterParser',
diff --git a/tests/parsing/test_parsing.py b/tests/parsing/test_parsing.py
index f7b552c2e48ff9ec2d44ba8f40687996ba3eb013..e401c9e88b094a996077674c0c91b99c32c9f1fb 100644
--- a/tests/parsing/test_parsing.py
+++ b/tests/parsing/test_parsing.py
@@ -23,8 +23,8 @@ from shutil import copyfile
 
 from nomad import utils, files
 from nomad.datamodel import EntryArchive
-from nomad.parsing import BrokenParser
-from nomad.parsing.parsers import parser_dict, match_parser, run_parser
+from nomad.parsing import BrokenParser, MatchingParserInterface
+from nomad.parsing.parsers import parser_dict, match_parser, run_parser, prefix_workflow, parsers
 from nomad.utils import dump_json
 
 parser_examples = [
@@ -188,11 +188,46 @@ def with_latin_1_file(raw_files):
     os.remove('tests/data/parsers/latin-1.out')
 
 
-def test_match(raw_files, with_latin_1_file, no_warn):
+@pytest.mark.parametrize('parsers, num_output_files', [
+    ([[MatchingParserInterface(
+        'workflowparsers.FHIVibesParser',
+        metadata_path=f'{prefix_workflow}/fhivibes/metadata.yaml',
+        mainfile_name_re=(r'^.*\.(nc)$'),
+        mainfile_mime_re=r'(application/x-hdf)',
+        mainfile_binary_header_re=br'^\x89HDF',
+        mainfile_contents_dict={'__has_all_keys': ['I', 'a', 'b']}
+    )], 1]),
+    ([[MatchingParserInterface(
+        'workflowparsers.FHIVibesParser',
+        metadata_path=f'{prefix_workflow}/fhivibes/metadata.yaml',
+        mainfile_mime_re=r'(application/x-hdf)',
+        mainfile_binary_header_re=br'^\x89HDF',
+        mainfile_contents_dict={'__has_key': 'aims_uuid'}
+    )], 1]),
+    ([[MatchingParserInterface(
+        'workflowparsers.FHIVibesParser',
+        metadata_path=f'{prefix_workflow}/fhivibes/metadata.yaml',
+        mainfile_mime_re=r'(application/x-hdf)',
+        mainfile_binary_header_re=br'^\x89HDF',
+        mainfile_contents_dict={'a': [0, 0, 0]}
+    )], 1]),
+    ([[MatchingParserInterface(
+        'workflowparsers.FHIVibesParser',
+        metadata_path=f'{prefix_workflow}/fhivibes/metadata.yaml',
+        mainfile_mime_re=r'(application/x-hdf)',
+        mainfile_binary_header_re=br'^\x89HDF',
+        mainfile_contents_dict={'I': [0, 0]}
+    )], 0]),
+    (parsers, correct_num_output_files),
+])
+def test_match(raw_files, with_latin_1_file, no_warn, parsers, num_output_files, monkeypatch):
     example_upload_id = 'example_upload_id'
     upload_files = files.StagingUploadFiles(example_upload_id, create=True)
     upload_files.add_rawfiles('tests/data/parsers')
 
+    if parsers:
+        monkeypatch.setattr('nomad.parsing.parsers.parsers', parsers)
+
     matched_mainfiles = {}
     for path_info in upload_files.raw_directory_list(recursive=True, files_only=True):
         mainfile = path_info.path
@@ -200,7 +235,7 @@ def test_match(raw_files, with_latin_1_file, no_warn):
         if parser is not None and not isinstance(parser, BrokenParser):
             matched_mainfiles[mainfile] = parser
 
-    assert len(matched_mainfiles) == correct_num_output_files, ', '.join([
+    assert len(matched_mainfiles) == num_output_files, ', '.join([
         '%s: %s' % (parser.name, mainfile)
         for mainfile, parser in matched_mainfiles.items()])